How do you increase the PHP time limit?

When a script reaches the maximum execution time limit, it results in a error. There are a number of ways to resolve this error:

Max avatar
Written by Max
Updated over a week ago

To protect web servers from abuse, a time limit is set for how long a PHP script can be executed. The actual time limit varies by hosting company, but usually, the maximum execution time is set between 30 and 60 seconds.

When a script reaches the maximum execution time limit, it results in a maximum execution time exceeded error. There are a number of ways to resolve this error:

Method 1 – edit file wp-config.php

Add the code below to the file wp-config.php:

set_time_limit(300);

Method 2 – edit file .htaccess

Add the code below to the file .htaccess:

php_value max_execution_time 300

Method 3 – edit php.ini

Add the code below to php.ini:

max_execution_time = 300

Can’t figure it out? You can always send a message to the support team via the chat bubble at the bottom right 🎈 Support to the rescue πŸ‘¨β€πŸ’» πŸ‘©β€πŸ’»

Did this answer your question?