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.
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
.
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
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
Latest posts by karsho (see all)
- Increase maximum query size max_allowed_packet for MySQL - March 29, 2020