How to Increase Request TimeOut in Apache


increase request timeout in apache

By default, Apache has a timeout of 60 seconds. If you have long-running requests on your website, then your visitors might get “Request Timed Out” error. To avoid this, here’s how to increase request timeout in Apache.

 

How to Increase Request TimeOut in Apache

Here are the steps to increase request timeout in Apache. You can do it in 2 ways – via PHP and Apache.

We will look at both methods

 

1. Using PHP

Open php.ini file in a text editor. You can find its location by going to http://yourdomain.com/phpinfo.php

In the output, scroll down to the section titled “Loaded Configuration File”. It will contain the location of your php.ini file

 

Open it in a text editor


$ sudo vim /usr/local/lib/php.ini

 

Add the following line


max_execution_time 600

to increase time out to 600 seconds

Save and close the file.

 

Restart Apache Server to apply changes

$ sudo service apache2 restart

 

 

2. Using Apache

Open Apache Server config file in a text editor. You will find it one of the following locations, depending on your Linux distribution:

  • /etc/apache2/httpd.conf
  • /etc/apache2/apache2.conf
  • /etc/httpd/httpd.conf
  • /etc/httpd/conf/httpd.conf

 

Add the following line to it, to increase time out to 600 seconds.


TimeOut 600

 

Restart Apache Server to apply changes

$ sudo service apache2 restart

That’s it! You have increase timeout in Apache.

About Sreeram Sreenivasan

Sreeram Sreenivasan is the Founder of Ubiq, a business dashboard & reporting platform for small & medium businesses. Ubiq makes it easy to build business dashboards & reports for your business. Try it for free today!