PHP + FastCGI = scripts hang forever

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
shrodi
-


Joined: 24 Aug 2007
Posts: 3

PostPosted: Mon Aug 27, 2007 5:59 pm    Post subject: PHP + FastCGI = scripts hang forever Reply with quote

Hi,

Just installed Abyss Web Server on my Mandriva 2007.1 Linux box in order to give it a try. I have PHP 5.2.1 and have the php-cgi executable. This is the PHP that came with my distro.

I followed instructions at http://www.aprelium.com/abyssws/php.html, and just wanted to let you know that if I set "Interface" to anything else than "CGI/ISAPI" in the scripting parameters, any script will hang forever, no matter the timeout value I set. By "forever", I let a script running just for fun while I was doing something else: after 2 hours my browser was still waiting for an output... And nothing in the logs.

Another thing is that, in this state (i.e. browser waiting for an output), the server is unstoppable. The only way I found to stop the process without rebooting the whole box was by pressing CTRL-C (the server says it will shut down, but it doesn't, and another abyssws process is created I don't know why) then by calling a "kill -9" on both abyssws processes (both at the same time, othwerwise one constantly reappears with a new PID!). Under normal conditions, the server stops well with a CTRL-C.

I wanted to report you this because the instructions did not expect this scenario and suggest switching to "CGI/ISAPI" only in the case where an Error 503 is met. Also, if you could suggest a possible reason why I can't get FastCGI working, that would be appreciated. Finally, the "unstoppable" thing is quite annoying...

If you need further info, please ask.

Thanks!
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Aug 27, 2007 6:01 pm    Post subject: Reply with quote

Be sure to follow the instructions exactly. I had this same issue yesterday and I re-followed the instructions and it worked. Maybe you simply missed something out?
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
shrodi
-


Joined: 24 Aug 2007
Posts: 3

PostPosted: Mon Aug 27, 2007 6:21 pm    Post subject: Reply with quote

AbyssUnderground wrote:
Be sure to follow the instructions exactly. I had this same issue yesterday and I re-followed the instructions and it worked. Maybe you simply missed something out?

Thanks for the quick answer. I have re-followed and re-read the instructions many times. As I said, everything works fine if I set "Interface" to "CGI/ISAPI" (it is said in the instructions to do that if we get a 503 error), maybe my PHP was compiled without FastCGI support, I don't know, but it's just that the hanging problem was reported no where I could find... so I wanted to report it.

It is also interesting to note that if I use the php executable instead of the php-cgi executable, I still get the same problem; however, to make it work, I have -- in addition to setting the interface to "CGI/ISAPI" -- to set "Type" to "Standard" instead of "PHP style" otherwise I get an Error 500 (logs say "broken pipe"). Of course, I also have to add a CGI header to my script in this case...
_________________
Eric
Québec, Canada
Back to top View user's profile Send private message
AbyssUnderground
-


Joined: 31 Dec 2004
Posts: 3855

PostPosted: Mon Aug 27, 2007 6:24 pm    Post subject: Reply with quote

Yes it would seem it was not compiled with FASTcgi support. However CGI/ISAPI is not that much slower that FASTcgi for most cases. It is only usually necessary for very high traffic sites.

The preconfigured package from aprelium supports FASTcgi but it is windows based only I believe so is of no use to you.
_________________
Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk
Back to top View user's profile Send private message Visit poster's website
shrodi
-


Joined: 24 Aug 2007
Posts: 3

PostPosted: Tue Aug 28, 2007 7:16 pm    Post subject: Reply with quote

AbyssUnderground wrote:
Yes it would seem it was not compiled with FASTcgi support.

That was it indeed: I compiled PHP myself with the "--enable-fastcgi" option and it works fine now.

Something interesting is that without fastcgi, a PHP script will wait for an "exec()" command to finish, even though the output is properly redirected; with fastcgi everything works fine: so for me having fastcgi working was quite important!

However, I think the symptoms I experienced should be added to the documentation with explanations.
_________________
Eric
Québec, Canada
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Aug 30, 2007 4:01 pm    Post subject: Reply with quote

shrodi,

All our apologies for this late reply. It seems that you have found the solution. Actually some distributions build PHP with no FastCGI support. But the behavior you have experienced should not have occurred that way: the server is not programmed to hang when not being able to connect to a FastCGI process.

We will check that and fix it in the coming version. Thanks.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
easytec
-


Joined: 17 Aug 2007
Posts: 55

PostPosted: Tue Sep 04, 2007 3:40 pm    Post subject: Reply with quote

I recommend you use Aprellium's PHP package (5.2.2).
After installing MySQL and running mysql-<operating_system_type__initials>.<operating_system_type__executable_file_extension> (like mysql-nt.exe for Windows) at start-up.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group