Re: calling php script from C - pclose problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jochem Maas wrote:
Ysidro wrote:

Hello,

Calling a php script from legacy c code using popen(), works great.
Problem: when php script is done, pclose() in c code fails with ECHILD, No child process, wait4() failed.

This is because the php script does not hang around to be wait'ed for; any idea how to make a command line php script behave like a normal child process that waits for its parent to get a status via a wait system call?


good question.

given that nobody has answered it probably means nobody here who has read
the list in the last couple of days knows the answer.

I assume google/yahoo didn't help you either (given your programming in C, it's
probably safe to assume your not new to the 'research the problem' game :-)

it might be worth asking on internals@xxxxxxxxxxxxx if you still don't get a reponse in the next 24 hours (make sure to mention that you already asked here!).



Thanks for the reply. Yes I've been 'researching' for last couple of days, only it sure doesn't help the results when php also contains a popen and pclose function! I'll try the internals suggestion if nothing comes in today. FYI: I have a suspicion that it has to do with php's primary purpose of getting invoked from web servers like Apache. You obviously don't want Apache to wait around to check status on php scripts. I could wrap the php script in a shell script to make sure I get a waiting child, but that should not be necessary if php would act properly when called in command line mode.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux