LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > PHP stderr lost

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2004, 06:09 AM
bogus bogus is offline
Member
 
Join Date: Dec 2003
Location: Brittany / France / Europe
Posts: 31
Default PHP stderr lost

Hello,

I don't kwon whether it is a PHP or LSWS bug.

When I restart LSWS, it reuses the previous PHP Fast-CGI process, but then, stderr is lost, as If PHP did not use the FastCGI connection to write its standard error, but still the standard error output (catchable by lsws only if it is its original parent).

That's very annoying, because I must kill PHP each time I restart LSWS.
Reply With Quote
  #2  
Old 04-17-2004, 07:26 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Thank you for the bug report.

PHP fast CGI does not strickly follow fast CGI specification, it still writes standard error to the original stderr (file handle 3).

PHP's stderr is assigned to a anonymous pipe when it was started by LSWS, LSWS log every thing received from the pipe to the stderr log. So when LSWS restarts, new LSWS instance can not pick up the old pipe connection thus can not log output of stderr any more.

We are thinking about always restarting another set of PHP processes instead of reuse the old one when LSWS restarts. But the difficult part is when/how to stop those old PHP processes.
Reply With Quote
  #3  
Old 04-18-2004, 12:43 AM
xing xing is offline
LiteSpeed Staff
 
Join Date: Oct 2003
Location: Los Angeles, California
Posts: 380
How about this.

1) When LSWS restarts, it spawns new php fastcgi group. Lsws would know at least the starting processid number of the new group.
2) Loop through current running processes and find all php processes with id lower than this number and send kill signal to them?

There is a loop-hole with this since lsws can kill long-running non-fastcgi spawned php proccesses such as scheduled cron jobs.
Reply With Quote
  #4  
Old 04-18-2004, 03:58 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,603
Thank you for the suggestion. :-)

Right now LSWS does graceful restart, means that the old LSWS instance still need the old PHP processes before it finishs all pending requests. Let new LSWS instance to manage old PHP processes may break the graceful restart.

I am thinking to have the watch dog process of old LSWS instance to manage old PHP processes as it knows when the old LSWS process exits, even crashes. Only need to find the best way to inform watch dog process about PIDs of children processes started by LSWS worker process.
Reply With Quote
  #5  
Old 04-20-2004, 02:43 AM
bogus bogus is offline
Member
 
Join Date: Dec 2003
Location: Brittany / France / Europe
Posts: 31
Quote:
PHP fast CGI does not strickly follow fast CGI specification, it still writes standard error to the original stderr (file handle 3).
So, that is definitly not a LSWS bug, but rather a PHP one. I'm going to report there. Thanks for the replies.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
replacing system php felosi PHP 3 07-16-2007 11:23 PM
Usability issue with LSAPI PHP jrmarino PHP 5 05-08-2007 01:54 PM
setup php in rails template cswilliams Install/Configuration 2 01-25-2007 08:21 AM
Best configuration for PHP LiteSpeed SAPI jeff Install/Configuration 6 10-19-2005 09:54 AM
Custom PHP integration RikitZap Install/Configuration 2 04-25-2005 06:52 PM


All times are GMT -7. The time now is 04:54 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.