PHP: Maximum execution time exceeded

If you write a PHP script that takes a long time to run, there is the following error message:

Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/xy.php on line xy

For this you have in php.ini (Debian: /etc/php5/apache2/php.ini) set the following value to prevent the error, and self-protection:

max_execution_time = 0;

but that’s not all, it must also be set to the following value to 0 (= infinity):

max_input_time = 0

Restart the server with /etc/init.d/apache2 restart.

In a production environment, with access from the outside, this configuration is not recommended.

Leave a Reply

Your email address will not be published. Required fields are marked *