Re: Suggestion on executing external programs from within php
| From: | Stuart | Date: | Fri, 23 Jan 2004 12:34:39 +0000 |
| Subject: | Re: Suggestion on executing external programs from within php | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-175506@lists.php.net to get a copy of this message | ||
John Clegg wrote:
I have finally had a chance to test your suggestion and I am still getting a browser timeout ?
The 1st program runs to completion even though the broswer times out. So it doesn't execute the second program :-(
I have also tried....
/usr/local/bin/process_file file1 &
exec('/usr/local/bin/process_file file1 &')
Any ideas??
Yup. Having checked the system function in the manual (http://php.net/system), it says this...
"Note: If you start a program using this function and want to leave it running in the background, you have to make sure that the output of that program is redirected to a file or some other output stream or else PHP will hang until the execution of the program ends."
So try this...
system('/usr/local/bin/process_file file1 > /dev/null &');
system('/usr/local/bin/process_file file2 > /dev/null &');
--
Stuart