ID:               44942
 Comment by:       alex at bartl dot net
 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:

Reproducable with PHP 5.2.9-1 on Windows2003 Server with Apache2.2
Workaround with calling session_write_close() before calling exec()
confirmed working

NOT reproducable with PHP 5.2.1 on Windows 2000 Server with IIS5

anyway, seems to be a duplicate of Bug#44994


Previous Comments:
------------------------------------------------------------------------

[2009-04-07 15:12:50] gouldee at netscape dot com

I am having the same or similar issue:
    OS: MS2003
    PHP: 5.2.6
    APACHE2: 2.2

The bug occurs with an PHP script that has a PHP passthru exec call
that hangs every now and then.  After the first hang occurs then any
passthru call hangs in the same manner.

I believe that the passthru call runs as I am calling a sendmail.exe
process that does send the E-Mail, however, the Browser page hangs after
the E-Mail has been sent by sendmail.exe called via passthru().

There are no PHP or Apache2 errors or warnings.  It seems that the
problem happens when (2) calls to the same .exe happens at the same
time, but, I have no real proof of this, as I can't provide execution
times for each instance of the sendmail.exe running.

This is a serious problem, as all pages that call an .exe process after
the initial hang will hang up as well. I can clear the bug by simply
stopping and restarting the Apache service.

I also note that If I run the page, that hangs up, manually in a
Command Prompt DOS window like:  D:\php page.php there are no hangs and
the process performs correctly even during and after the first showing
of the bug.  So the problem seems to be when PHP does an exec call in
conjunction with Apache, as I said even during the time a hang occurs I
can still exec passthru commands from a command prompt.

I can also run any page that calls PHP as long as the page does not
have any exec or passthru calls in it, and all pages with HTML only runs
fine as well during the hang period.

------------------------------------------------------------------------

[2009-02-26 15:14:32] frase at cs dot wisc dot edu

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.

------------------------------------------------------------------------

[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!

------------------------------------------------------------------------

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

Reply via email to