Forum

FastCGI timeout too short: how to increase?

Yassen Damyanov
1 October 2008, 23:29
Hi Hugo,

This is now (my first) real support request:

I am installing webmail interfaces on my servers; like roundcube (php-based, http://roundcube.net) and one particular issue I have is for scripts that run longer, someone kills them after 5 seconds and I get a "500 Internal Server Error" page.

Here are the relevant parts of all involved config files:

httpd.conf:
----cut here-------------------------------------
TimeForCGI = 60

FastCGIserver {
FastCGIid = PHP5webmail
ConnectTo = 127.0.0.1:2006
Extension = php, php5
SessionTimeout = 30
}
VirtualHost {
Hostname = webmail.itlabs.bg
WebsiteRoot = /path/to/vhosts/sub.doman.tld/htdocs
StartFile = index.php
AccessLogfile = /path/to/vhosts/sub.doman.tld/logs/access.log
ErrorLogfile = /path/to/vhosts/sub.doman.tld/logs/error.log
ExecuteCGI = yes
FastCGI = PHP5webmail
}
----cut here-------------------------------------

php-fcgi.conf:
----cut here-------------------------------------
Server = /usr/bin/php5-cgi; 127.0.0.1:2006; www-data:www-data; /path/to/vhosts/sub.doman.tld/conf/php.ini
----cut here-------------------------------------

/path/to/vhosts/sub.doman.tld/conf/php.ini:
----cut here-------------------------------------
max_execution_time = 180
max_input_time = 60
----cut here-------------------------------------

I guess "TimeForCGI" does not affect FastCGI jobs, but anyway, I get this on the Hiawatha error log for that subdomain:

/path/to/vhosts/sub.doman.tld/logs/error.log:
----cut here-------------------------------------
Wed 01 Oct 2008 22:04:53 +0300|10.48.52.201|/path/to/vhosts/sub.doman.tld/htdocs/atmail/util.php|CGI timeout
----cut here-------------------------------------

I did try to fix this for quite a while and I cannot. I've searched the man page, but still no luck.

So that's pretty much all that I can report back.
Any help will be highly appreciated!

Thanks,
Yassen
Cristian Gilè
2 October 2008, 11:38
Yassen Damyanov
2 October 2008, 13:03
I've read that thread, thanks, but probably I still miss something. Trying to reflect what you say there, here are the new relevant settings in my httpd.conf:

----cut here-----------------------------------------
Binding {
TimeForRequest = 60
MaxRequestSize = 16
}

TimeForCGI = 60
----cut here-----------------------------------------

Doesn't seem to help, though -- the application behaves the same way. (Yes, server restarted couple of times, as well as the php-fcgi daemons, no change.)

Any suggestions would be highly appreciated!

Thanks,
Yassen
Hugo Leisink
2 October 2008, 15:01
TimeForCGI is a virtual host setting, not a global setting. Move it inside the VirtualHost block to make it work. Please let me know if that solves your problem.
Yassen Damyanov
2 October 2008, 22:50
Problem solved!!

Hugo, thank you very much.

BTW, the default config that was installed out of the debian package has that directive hanging out in the global context, commented. I just uncommented it and changed the value. I guess it's legal for it to be there (probably defining the way the default host behavior). But it seems like a good idea to put a commented entry into the virtual-host sample as well ....
Hugo Leisink
3 October 2008, 10:08
You're right. Thanks for the tip. I've moved it into the example VirtualHost block.
This topic has been closed.