Project

General

Profile

Feature #737

php fcgi does not restart if lighttpd restarts

Added by Michael about 14 years ago. Updated almost 12 years ago.

Status:
Invalid
Priority:
High
Category:
mod_fastcgi
Target version:
-
ASK QUESTIONS IN Forums:

Description

While using lighttpd on a centos 4.3 installation with kernel 2.6.16.1 (no tweaks to teh kernel). Everytime I made adjustments to php I had to killall php processes in order to restart the php processes to get those updates. Even thought I went and killed all of the php processes I had to restart twice in order to get the php processes started again.

#1

Updated by Anonymous almost 14 years ago

I think this is an issue with php-cgi spawn from lighttpd. When lighttpd restarts, the old lighttpd shuts down the port it listens to so the new process can bind to it. However the old php-cgi parent still binds to the same port (1026 for example), which the new php-cgi cannot bind, that leads to failure to start.

My solution is to use spawn-fcgi even in localhost so you can manage your PHP FastCGI and lighttpd processes independently.

See http://hostingfu.com/article/use-spawn-fcgi-for-lighttpd-php-fastcgi

-- Scott

#2

Updated by admin about 13 years ago

If you killed all PHP procecsses, the PHP port should be free.

#3

Updated by Anonymous over 12 years ago

Same problem here for 1.4.16 (Debian backport). From time to time, php-cgi processes are not linked to lighttpd, so when a restart is initiated, php doesn't suppress its children, and no php process is created again.
I must point out the fact that when running php from within a php script (using system('php-cgi ...') or system('/a/php/file/with/good/headers.php')) the process goes directly to a zombie one and stop working at all. I couldn't manage to make it work correctly so far...

-- Yvan

#4

Updated by admin over 12 years ago

Same problem here for 1.4.16 (Debian backport).

Can you try 1.4.18?

I must point out the fact that when running php from within a php script (using system('php-cgi ...') or system('/a/php/file/with/good/headers.php'))

Shouldn't you use php-cli? Running it that way is not CGI.

#5

Updated by Anonymous over 12 years ago

Same here
lighttpd-1.4.18
CentOS 5.1
PHP 5.2.5
even killall php-cgi does nothing and it keeps holding memory, only restarting the server would solve the problem.

-- masryalex

#6

Updated by Anonymous about 12 years ago

Replying to :

Same here
lighttpd-1.4.18
CentOS 5.1
PHP 5.2.5
even killall php-cgi does nothing and it keeps holding memory, only restarting the server would solve the problem.

try killall -HUP php-cgi

#7

Updated by stbuehler almost 12 years ago

  • Status changed from New to Fixed
  • Resolution set to invalid

iirc php needs different signals in different versions to terminate... but we already knew that php sucks. There is a kill-signal option for this.

Anyway i recommend to spawn php external.

#8

Updated by stbuehler almost 12 years ago

  • Status changed from Fixed to Invalid

Also available in: Atom