ID:               41593
 Comment by:       severn-php at xephris dot net
 Reported By:      jonepet at dcvhost dot no
 Status:           Feedback
 Bug Type:         CGI related
 Operating System: Linux
 PHP Version:      5.2.3
 Assigned To:      dmitry
 New Comment:

Re: mod_fcgid: I see... I guess I'll modify mod_fcgid myself for that
setup.

That doesn't explain the mod_fastcgi problems though. I thought it
might be something with my setup so I rebuilt it from scratch... might
have had some old crap left behind. I don't get 500 errors with PHP
5.2.3 + mod_fastcgi 2.4.2 + Apache 1.3.37 anymore, so it does look fixed
in 5.2.3... but I get another strange problem: doing a graceful restart
shortens the sleep time to zero. i.e.

<?php
 $a = time();
 sleep(30);
 echo time()-$a;
?>

Going to this page then doing a graceful after 5 seconds would give "5"
instead of the expected "30".

php5.fcgi==
#!/bin/sh
export PHP_FCGI_CHILDREN=4
exec /opt/php5/bin/php-cgi $*

For the record, PHP 4.4.7 dies with a 500 error, but that's not a big
problem for us...

Could the OP perhaps provide us some info on what versions of Apache
and mod_fastcgi/mod_fcgid so we can try replicating it?


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

[2007-06-13 17:40:12] [EMAIL PROTECTED]

PHP/fastcgi catches SIGTERM and always does graceful shutdown, however
mod_fcgid sends SIGTERM then waits for one second and sends SIGKILL if
PHP process isn't exited.

So this is not a PHP issue.

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

[2007-06-12 19:31:57] severn-php at xephris dot net

>From the looks of the changelog, Bug #36158 was fixed in 5.1.3

I just tried that with mod_fcgid 2.1 and Apache 2.2.4 on x64 Linux and
it too "died". mod_fcgid sends SIGTERM to the PHP process which dies
returning a blank page. I also tried it with mod_fastcgi 2.4.2 and
Apache 1.3.37, that died with the 500 error.

I've also tried PHP 5.1.6 and 5.2.3, same issue.

So... it looks to me like the bug was never actually fixed... (not in
5.x at least). I get the same behaviour with 4.4.7 (blank screen with
mod_fcgid, 500 error with mod_fastcgi)

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

[2007-06-05 07:58:15] jonepet at dcvhost dot no

As of the close/last comment of Bug #36158 it was working at that time.
I don't know if it really did, or if there was any releases with this
fix.

I didn't meant "previous version" but "earlier version", in the
original description, referring to the last comment of Bug #36158.

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

[2007-06-05 07:34:58] [EMAIL PROTECTED]

In what PHP version did it work?

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

[2007-06-04 23:06:35] jonepet at dcvhost dot no

Description:
------------
This is a duplicate of older closed Bug #36158. Solved in previous
version, but broken again in newer (because of replaced lib?).

The FastCGI module in PHP does not handle graceful/SIGTERM
shutdown/reload correctly. When sending a graceful reload to Apache, all
running PHP processes dies, and Apache return "500 Internal Server
Error" to waiting HTTP clients.

Reproduce code:
---------------
<?php
  sleep(10);
  echo "Done";
?>

Open in a web browser and then do an apache2ctl graceful on the server.

Expected result:
----------------
"Done" should be printed to the web browser after 10 seconds.

Actual result:
--------------
"Internal Server Error" to browser and "premature end of script
headers" to log file.


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


-- 
Edit this bug report at http://bugs.php.net/?id=41593&edit=1

Reply via email to