How to prevent script timeout in phpMyAdmin

« Back :: Tagged with Databases :: HowTo's :: Migrating :: phpMyAdmin :: Snippets :: XAMPP ::

This is how to prevent phpMyAdmin from timing out when importing an sql file.

I use XAMPP, and each time I was trying to import a large sql file, or a gzip file for that matter, phpMyAdmin threw a timeout error in my face.

After some investigation I came to this simple solution; In the file which is in your phpMyAdmin's install dir, you put the snippet below:

 * Set script timout in seconds
 * 0 = unlimited
$cfg['ExecTimeLimit'] = 0; /* no script timeout */


Fatal error: Maximum execution time of 300 seconds exceeded in
C:\xampp\phpMyAdmin\libraries\import\sql.php on line 129


Import has been successfully finished, 33211 queries executed.



Anonymous @ November 17th, 2010 - 03:00

works as advertised

Import has been successfully finished, 5749 queries executed!

Anonymous (not verified) @ April 7th, 2013 - 11:14

Can you plz tell me how much time it is taking for execute?

deuxcode @ April 10th, 2013 - 07:30

It depends on how big your import file is and on your computer performance. It can take quite a while actually.

Anonymous @ March 6th, 2011 - 20:51

Thx for the tip! I'm trying to import a 465mb sql file and I keep getting a timeout message even if the file is gzipped in to a 26 mb archive.

Anonymous (not verified) @ June 8th, 2012 - 13:51

I can now see the progress even thought its not done.Thanx

Jose Philip Raja (not verified) @ July 2nd, 2012 - 13:02

Import has been successfully finished, 31102 queries executed. ()

Chris Vickers (not verified) @ July 10th, 2012 - 12:11

Works Perfectly. Really useful tip

Anon001 (not verified) @ April 22nd, 2013 - 12:13

Thanks! Saved my day!

Anonymous (not verified) @ May 23rd, 2013 - 02:11

Thank you very much.
Very usefull tip.

Anonymous (not verified) @ August 22nd, 2013 - 12:15

Worked perfectly, thank you very much!

Rem (not verified) @ December 15th, 2013 - 07:48

Thanks for the snippet. I added it to my file right before the closing ?> tag and it worked great.

Nick Goodey (not verified) @ April 4th, 2014 - 02:02

Worked great importing a 26MB Moodle backup

Thanks from Lincoln University

Ash (not verified) @ April 18th, 2014 - 16:28

Hey you saved my day and work! thank you very much!

Deon (not verified) @ June 22nd, 2014 - 13:42

Import has been successfully finished, 135965 queries executed.

kenny (not verified) @ October 8th, 2014 - 11:13

Waow! Can't thank you enough. Thanks for the excellent tip. I believe you already know my experience before I came across your tip. Thanks again.

Deb (not verified) @ October 8th, 2014 - 14:52

Thank you! Thank you so much for this! It has driven me crazy on XAMPP for ages. And now it finally works.

Webesign7 (not verified) @ April 14th, 2015 - 23:38

Thanks ! It helped me a lot !

Sergiu C.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <blockquote> <blockcode> <pre> <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Copyright © 2015
Powered by Drupal. Valid XHTML 1.0 Strict and CSS 2.1.