≡ Menu

How to Increase PHP Max Execution Time in Nginx

php logoIf you have wordpress site or other website with limited resource, your will get error message “504 Gateway Time-out”. So here is how to increase the timeout your website.

Step 1: Edit php.ini

# nano /etc/php5/fpm/php.ini
max_execution_time = 300

Step 2: Edit PHP-FPM

# nano /etc/php5/fpm/pool.d/www.conf

Set …

request_terminate_timeout = 300

Step 3: Edit Nginx Config

# nano /etc/nginx/sites-available/your-domain.com

Set …

fastcgi_read_timeout 300; 
# nano /etc/nginx/nginx.conf

Set …

http {
	#...
        fastcgi_read_timeout 300;
	#...
}

Step 4: Restart PHP-FPM & Nginx

service php5-fpm restart
service nginx restart
{ 0 comments… add one }

Leave a Comment

CAPTCHA
*