I'm having an issue I can't quite figure out with php and fastcgi. I have a need to run a process in the background, but I'd like to grab the PID so I can monitor its progress and report to the user when it's finished via an AJAX request.
My only issue is that FastCGI seems to crash when I launch a process with the WshShell->Exec method, but not when I use the WshShell->Run method. It actually works fine, returns the correct pid, and runs the process in the background...but once script execution is done, the fastcgi worker process crashes. If I refresh the page several times and fastcgi hits its limit on child processes, I get a 500 internal error stating that the worker process crashed, until a new worker process is spawned a second later.
The following also shows up in the error log when the worker process crashes:Faulting application php-cgi.exe, version 5.3.6.0, faulting module unknown, version 0.0.0.0, fault address 0x572529b0.
Any idea why Exec would crash the process but Run wouldn't?
Works:
<?
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run("ping 127.0.0.1",0,false);
?>
Crashes:
<?
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Exec("ping 127.0.0.1");
?>