multiple exec statements - run each prog in bg - no waiting
Posted: Wed Jan 23, 2008 7:04 am
I have a script the likes of
Currently, when launcher.php is run, only the first external program is executed (although I have run each batch file from the cmd line successfully).
What I would like to happen is to have each external program run immediately as a background process, and not wait until externalprog1 is finished before executing externalprog2 etc.
I simply want to execute them all no waiting.
PHP5.2.0/Apache2.2/WinXPPro SP2 (by way of background).
Thanks and kind regards, Andrew
Code: Select all
// launcher.php
exec("externalprog1.bat",$output);// externalprog1.bat contains a single line like-->@C:\php\php.exe -q process1.php
exec("externalprog2.bat",$output);// externalprog2.bat contains a single line like-->@C:\php\php.exe -q process2.php
exec("externalprog3.bat",$output);// externalprog3.bat contains a single line like-->@C:\php\php.exe -q process3.php
exec("externalprog4.bat",$output);// externalprog4.bat contains a single line like-->@C:\php\php.exe -q process4.php
What I would like to happen is to have each external program run immediately as a background process, and not wait until externalprog1 is finished before executing externalprog2 etc.
I simply want to execute them all no waiting.
PHP5.2.0/Apache2.2/WinXPPro SP2 (by way of background).
Thanks and kind regards, Andrew