Categories

max_execution_time

Дарья Миронова November 16, 2015
No votes yet.
Please wait...

The PHP variable max_execution_time is the maximum time a PHP script can run. The default value is 30 seconds which should be enough for most web applications. The execution time starts when PHP has completed the interpretation of the script and ends when the last statement has executed. The tasks that an operating system and the PHP interpreter has to do are not counted in the execution time.

If a script runs for more than the max_execution_time, PHP will return a timeout error and terminate the script.

There are cases in which the default max_execution_time of 30 seconds is not enough. You may need to increase this to a value suitable for your web application.

You can control the amount of time PHP allows scripts to run by changing the max_execution_time directive in your php.ini file.

To change the maximum execution time, use a text editor to modify the max_execution_time directive in your php.ini file. For example, to set the maximum execution time to 10 seconds, use the following setting:

max_execution_time = 10

You may visit http://php.net/ in order to see another examples and directives.

You also may set max_execution_time via PHP script. PHP has a function called set_time_limit which can be called to override the value of the max_execution_time variable in php.ini. For example, to change the execution time limit for just one PHP script to 15 minutes, add the following line at the beginning of the PHP script:

set_time_limit(900);

This will override the settings in php.ini for that particular script only.

In order to verify your current max_execution_time, please contact your hosting provider.

Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

Comments are closed.