I would like to execute a PHP script from a C program and store the returning content in to a C variable.
I tried like following but it doesn\'t work:
Remember when you use execl()
it will "exit on success". So, you will never see "End php function" because it will never get to that line of code.
To overcome this problem, you may either use system
or use fork()
to create a child process and in your child process use execl
or any other function from the exec
family.