Fatal error: Maximum execution time of 300 seconds exceeded

Who having work with PhpMyadmin at Wamp, Xampp, WordPress, Drupal or Magento, surely they got “Fatal error: Maximum execution time of 300 seconds exceeded” Error at-least once. It’s may 300 seconds or 30 seconds or else. But You may get this error while import / export the Database or Data.

Fatal error: Maximum execution time of 300 seconds exceeded

Here we are giving 4 Solutions for this Fatal error. Two solutions for temporarily and another two for permanent Solution. And it’s all for WAMP, XAMPP, WordPress, Drupal, Magento and so on. This is common issue, so common Answer(s).

Temporary Solution 1: ini_set

Add following code at the Beginning of your script,

ini_set(‘MAX_EXECUTION_TIME’, 6000);

Here, 6000 is Seconds. 6000s = 100 minutes. If you want to set Unlimited, set 0.
wordpress Fatal error Maximum execution time of 300 seconds exceeded

Permanent Solution 1: ExecTimeLimit

Go to following path and open config.default.php file,
D:\wamp\apps\phpmyadmin[version]\libraries\config.default.php
In this file, search and edit following code,

$cfg[‘ExecTimeLimit’] = 6000;

Here, 6000 is Seconds. 6000s = 100 minutes. If you want to set Unlimited, set 0.

Temporary Solution 2: set_time_limit

set_time_limit(6000);

Use above set_time_limit code to fix this execution problem. This is next temporary solution. Add this code at top of your script. Here, 6000 is Seconds. 6000s = 100 minutes. If you want to set Unlimited, set 0. If you set 0, it’s allows your script to run forever.

Permanent Solution 2: PHP.ini and my.ini

Open your php.ini file and update/add following code,

post_max_size = 1000M
upload_max_filesize = 1000M
max_execution_time = 6000
max_input_time = 6000
memory_limit = 1000M

And open my.ini file from following path,
Drive:\xampp\mysql\bin\my.ini
Drive:\wamp\bin\mysql\mysql[version]\my.ini
then update/add below code,

max_allowed_packet = 500M

Drupal Fatal error Maximum execution time of 300 seconds exceeded

Hints for Maximum execution time of 30 seconds exceeded Problem

Notes:
1) Avoid to set 0 or -1 for Unlimit. Set any large value.
2) you can use this methods for any wamp, xampp, wordpress, drupal, magento and so on.


Import Big Database (SQL file) to PhpMyAdmin WAMP Server

4 Solutions for Fatal error: Maximum execution time of 300 seconds exceeded in WordPress

Just share...Share on FacebookShare on Google+Tweet about this on TwitterPin on PinterestEmail this to someone
The following two tabs change content below.
I am Karthik, software engineer by profession. You can find and follow me, from Social Media or here. Google+

Latest posts by karsho (see all)

This entry was posted in Database, Error, local server, Wamp, Wordpress.

Leave a Reply

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

Please Fill this Sum * Time limit is exhausted. Please reload the CAPTCHA.