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
Resources¶
Updated by Daniel Curtis over 9 years ago
- Description updated (diff)
- Status changed from New to In Progress
- % Done changed from 0 to 50
Updated by Daniel Curtis over 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100