Graceful DOS Command Error-Handling w/PHP popen()
- by Captain Obvious
PHP 5.2.13 on Windows 2003
I am using the DOS Start /B command to launch a background application using the PHP popen() function:
popen("start /B {$_SERVER['HOMEPATH']}/{$app}.exe > {$_SERVER['HOMEPATH']}/bg_output.log 2>&1 & echo $!", 'r');
The popen() function launches a cmd.exe process that runs the specified command; however,…