ID: 44942 Comment by: frase at cs dot wisc dot edu Reported By: inqualab1985 at gmail dot com Status: No Feedback Bug Type: Program Execution Operating System: Windows 2000 SP4 PHP Version: 5.2.5 New Comment:
This is happening to me as well, PHP 5.2.8, Apache 2.2.11, Windows 2000 Pro SP4. However, it only seems to happen when PHP is configured as an Apache module (php5apache2_2.dll); when I configure it as CGI, it works fine. I also have anecdotal evidence that it's related somehow to other sockets being open on the system. In my case, we have a VB (compiled) application with an embedded IE control, and also opens the serial port to communicate with some hardware. If that hardware is plugged in (and PHP is loaded as a module), then our scripts hang at 'exec("ping -n 1 somehost")'. If I unplug the hardware (so the serial port can't be opened), it works. Previous Comments: ------------------------------------------------------------------------ [2009-02-17 10:12:38] russell_anam at hotmail dot com I can indeed confirm that this bug exists in the latest PHP version (PHP 5.2.8). exec() would randomly hang the Apache and the only solution was to restart the whole server (service restart did not help). I can also confirm that vlabella's solution INDEED worked for us. Since this workaround works I think it's safe to say this is indeed a PHP bug that needs to be fixed ASAP. ------------------------------------------------------------------------ [2009-01-29 18:21:30] rolinger1 at hotmail dot com I came across this article searching for a similar problem. I am using Perl 5.10 though but am having the same issue with Apache 2.2. That being said, I believe the issues are the same and that the problem is with Apache and not php or perl. With Perl I do a backtick call and Apache's CGI hangs. The windows system processes shows 1 cmd running and 1 perl app running for each time I click on the called web script. Perl call: @files = `dir ../configs /0:D /A:-D` ; Somehow, apache uses the backtick command to launch a "cmd" console process which in turn executes the system call "dir..." I say the Apache CGI hangs because other PHP scripts (that don't do system calls) all still seem to work. But after the first CGI hang, all other Perl calls hang - even scripts that don't have system calls in them. Scripts with system calls load another pair of cmd/perl processes and return no data, scripts without system calls loads another perl process but does return data. After the initial hang though, all related processes (cmd or perl) remain in memory and eventually Apache just hangs altogether. And when that happens we are forced to do a system reboot - simply doing a service restart has won't work. ------------------------------------------------------------------------ [2009-01-15 16:54:54] bill at sammer dot com session_write_close fixes it for me too. Thanks vlabella! ------------------------------------------------------------------------ [2008-12-04 04:35:44] dominic dot manley at det dot wa dot edu dot au Big thanks to vlabella who led us to a work-around. This is one VERY frustrating bug to track down! We have an Apache/PHP 5.2.3/Win2003 setup and concurrent calls to a script that exec()-ed the same command-line .exe caused the process to get caught up on the server. Apache wouldn't let go of it and the only way to kill the process and get the site/sometimes whole server back was to restart Apache. I never would have suspected sessions causing this issue... none of our investigations led us close to that direction. However, vlabella got it spot on... Calling session_write_close() before an exec() (or simply never initiating session support to start with using session_start()) works around the issue. ------------------------------------------------------------------------ [2008-10-21 09:26:44] neododge at free dot fr The same problem happens for me on PHP 5.2.6 / Apache 2.2.9, Apache won't run any PHP after I try an exec/passthru/`` -no matter what command I try. Only way to get PHP back seems to be closing all browser windows that point to my server and waiting for a while before trying to use a PHP page again. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/44942 -- Edit this bug report at http://bugs.php.net/?id=44942&edit=1