Increasing Your PHP Max Execution Time

If you are receiving errors due to PHP scripts timing out when manipulating large amounts of data, such as a large import or export, you may need to increase the max execution time in PHP. In this article, we will show you how to do so.

When following these steps, keep in mind that these are generic instructions, as we cannot possibly account for every change in your web hosting environment. If these steps are unable to resolve your issue, or if you have any concerns about them, your best and quickest solution is to contact your web host.

Note: Only one of the following steps should be necessary. If one of them resolves your issue, there is no need to do the other.

Modifying your max execution time in php.ini

Depending on your hosting provider, you may have a php.ini file within your home directory. If it is present, find the max_execution_time parameter and modify it to increase the number of seconds PHP scripts are allowed to run.

max_execution_time = 300

Modifying your max execution time in .htaccess

If you are unable to change your max execution time from within a php.ini file, you may be able to change it within your .htaccess file. This file is typically located within your home directory. If you don’t see it, be sure you are able to see hidden files.

Place the following in the top of your .htaccess file:

php_value max_execution_time 300