Support #651
Increase PHP Execution Time For Nginx
Description
This is a guide on how to increase the PHP execution time for php-fpm on nginx.
- Change max execution time limit in the main PHP config from the default 30 seconds to 300 seconds.
vi /usr/local/etc/php.ini
- And set:
max_execution_time = 300
- And set:
- Edit the php-fpm config:
vi /usr/local/etc/php-fpm.conf
- And set:
request_terminate_timeout = 300
NOTE: Ifrequest_terminate_timeout
is commented out, this value will be taken from themax_execution_time
in the php.ini file.
- And set:
- To increase the time limit for www.example.com by:
vi /usr/local/etc/nginx/conf.d/www.example.com.conf
- And add the
fastcgi_read_timeout 300
statement:location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_read_timeout 300; }
- And add the
- And restart nginx and php-fpm:
service nginx restart service php-fpm restart