Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


By default, max_execution_time is 30 (seconds). In this tutorial, I will guide you increase this value both on nginx and apache server.

Nginx server

Changes in php.ini

On CentOS: php.ini is saved in: /etc/php.ini

...

Code Block
languagebash
linenumberstrue
max_execution_time = 3000

 (Increase php execution time to 3000 seconds)

Changes in Nginx Config

On file nginx config for your site, add this line fastcgi_read_timeout 3000; like this:

Code Block
languagebash
linenumberstrue
location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
                fastcgi_read_timeout 3000;
        }

(Increase request time out to 3000 seconds). Just add this line fastcgi_read_timeout 3000; keep default other configurations. You can preference this tutorial Install phpFox on nginx server for more detail

...

Check your result

Check on phpinfo

Apache Server

Changes in php.ini

On CentOS: php.ini is saved in: /etc/php.ini

 

On Ubuntu: php.ini is saved in: /etc/php/7.0/apache2/php.

...

ini (which 7.0 is php version that installed in your server)

Code Block
languagebash
linenumberstrue
max_execution_time = 3000

 

Reload apache

Run these commands:

Code Block
languagebash
linenumberstrue
#CentOS
systemctl restart httpd
 
#Ubuntu
systemctl restart apache2