How do I increase the apache timeout directive in .htaccess? I have a LONG $_POST['script'] that takes a user probably 10 minutes to fill in all the data. The problem is if it takes too long than the page times out or something and it goes to a webpage is not found error page. Would increasing the apache timeout directive in .htaccess be the answer I'm looking for. I guess it's set to 300 seconds by default, but I don't know how to increase that or if that's even what I should do... Either way, how do I increase the default time? Thank you.
if you have long processing server side code, I don't think it does fall into 404 as you said ("it goes to a webpage is not found error page")
Browser should report request timeout error.
You may do 2 things:
Based on CGI/Server side engine increase timeout there
PHP : http://www.php.net/manual/en/info.configuration.php#ini.max-execution-time - default is 30 seconds
In php.ini:
max_execution_time 60
Increase apache timeout - default is 300 (in version 2.4 it is 60).
In your httpd.conf (in server config or vhost config)
TimeOut 600
Note that first setting allows your PHP script to run longer, it will not interferre with network timeout.
Second setting modify maximum amount of time the server will wait for certain events before failing a request
Sorry, I'm not sure if you are using PHP as server side processing, but if you provide more info I will be more accurate.
max_execution_time
- that is for a long running script. E.g. a large file upload. AFAIK, doesn't affect how long a user can be idle. re Timeout 10080
. I think not a good idea - ties up more resources unnecessarily. httpd.apache.org/docs/2.0/mod/core.html#timeout says "timer used to be 1200 but has been lowered to 300, which is still far more than necessary..." –
Assist Just in case this helps anyone else:
If you're going to be adding the TimeOut
directive, and your website uses multiple vhosts (eg. one for port 80, one for port 443), then don't forget to add the directive to all of them!
This solution is for Litespeed Server (Apache as well)
Add the following code in .htaccess
RewriteRule .* - [E=noabort:1]
RewriteRule .* - [E=noconntimeout:1]
RewriteRule ^/?(.*) ws://127.0.0.1:%{ENV:WEBSOCKET_PORT}/$1 [P,L,E=noconntimeout:1,E=noabort:1]
–
Organicism © 2022 - 2024 — McMap. All rights reserved.
max_execution_time = 10080
to the php.ini. So far I troubleshooted it 5 times on 3 browsers with success. Would this alone allow a user to be idle on a post form page for 3 hours (10080 sec = 3 hours) before clicking submit and avoiding the webpage is not found error? Like I said I've been good so far but still don't feel 100%. Also, is the Timeout 300 changed to Timeout 10080 OK? Would that exceed the max allowed time and would this even be necessary to avoid the problem I'm experiencing. Thank you for the great answer! – Technical