How to Solve “Fatal error: Maximum execution time of 300 seconds exceeded” phpMyAdmin Problem in XAMPP

2
Updated on 10 June 2023
XAMPP Logo

Importing large .sql file in phpMyAdmin in XAMPP takes time. Depending on how huge is your sql file size, the importing process can reach above the maximum execution time. When the maximum execution time limit is reached, it will stop the importing process and trigger the error message: Fatal error: Maximum execution time of 300 seconds exceeded along with some information about the error's file and line location.

In XAMPP version 8.2.4-0, the complete error message that I got when trying to import a 21 MB .sql file was:

Fatal error: Maximum execution time of 300 seconds exceeded in C:\xampp\phpMyAdmin\libraries\classes\Dbal\DbiMysqli.php on line 209

The file size is not that large (only 21 MB), but the time required to import the sql file is apparently more than the default maximum execution time limit of 300 seconds or 5 minutes 😀 Later I found out that it took ±6 minutes 24 seconds to fully import a 21 MB .sql file.

Change the phpMyAdmin Configuration

The only way to fix the Fatal error: Maximum execution time of 300 seconds exceeded issue is by increasing the time limit.

How to increase the maximum execution time in phpMyAdmin in XAMPP

We need to edit config.inc.php file to override the default value of maximum execution time that is set in phpMyAdmin default configuration file (C:\xampp\phpMyAdmin\libraries\config.default.php). These are the steps to reconfigure the maximum execution time:

  1. Open file config.inc.php in folder C:\xampp\phpMyAdmin.

  2. Add $cfg['ExecTimeLimit'] = 3600; to the end of the file, just before the comment section "End of servers configuration".

    The number 3600 means 3,600 seconds or 1 hour. You can change the number to maximum execution time you need in seconds.

  3. Save the change.

Now you can import large .sql files without interruptions anymore.

Note:
If you get similar error when running a PHP script (not when importing database in phpMyAdmin), check this solution to fix Fatal error: Maximum execution time of 120 seconds exceeded in XAMPP instead.

2
First published by  on Last Modified on 10 June 2023.

2 Comments

Add new comment
  • how to add et in which line $cfg[‘ExecTimeLimit’] = 3600; to the end of the file, just before the comment section “End of servers configuration”.

    • If you have XAMPP version 8.2.4, it will be around line 56.

      For example, the default config.inc.php in v8.2.4 should have these codes near the end of file:

      $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
      $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
      /*
      * End of servers configuration
      */

      Then if you add the code, it will be:

      $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
      $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
      $cfg['ExecTimeLimit'] = 3600;
      /*
      * End of servers configuration
      */

Add A Comment

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