[php] Maximum execution time in phpMyadmin

When I try to execute (some) queries in phpMyadmin I get this error

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140

because I have a very large table (over 9 millions records)

I have edited the file C:\xampp\php\php.ini

and changed the value of "max execution time" from 60 to 1000 then restarts the PHP and still have the same error.

Any solution?

This question is related to php mysql database xampp execution-time

The answer is


Probabily you are using XMAPP as service, to restart XMAPP properly, you have to open XMAPP control panel un-check both "Svc" mdodules against Apache and MySQL. Then click on exit, now restart XMAPP and you are done.


'ZERO' for unlimited time.

C:\Apache24\htdocs\phpmyadmin\libraries\Config.class.php

/**
 * maximum execution time in seconds (0 for no limit)
 *
 * @global integer $cfg['ExecTimeLimit']
 */
$cfg['ExecTimeLimit'] = 0;

You could also import the large file right from MySQL as query or a PHP query.

500,000 rows just took me 18 seconds to import on local server, using this method.

(create table first) - then:

LOAD DATA LOCAL INFILE 'Path_To_Your_File.csv' 
INTO TABLE Your_Table_Name 
FIELDS TERMINATED BY ',' 
LINES TERMINATED BY '\n' 

In php.ini you must check mysql.connect_timeout either. That's responsible for socket closing and returning the Fatal. So, for example, change it to:

mysql.connect_timeout = 3600

That time will be always counted in seconds, so in my example you have 1 hour.


What worked for me on WAMP was modifying file: \Wamp64\alias\phpmyadmin.conf, lines:

 php_admin_value max_execution_time 600
 php_admin_value max_input_time 600

I did not have to change the library file.


I faced the same problem while executing a curl. I got it right when I changed the following in the php.ini file:

max_execution_time = 1000 ;

and also

max_input_time = 1000 ;

Probably your problem should be solved by making above two changes and restarting the apache server.

Even after changing the above the problem persists and if you think it's because of some database operation using mysql you can try changing this also:

mysql.connect_timeout = 1000 ; // this is not neccessary

All this should be changed in php.ini file and apache server should be restarted to see the changes.


Your change should work. However, there are potentially few php.ini configuration files with the 'xampp' stack. Try to identify whether or not there's an 'apache' specific php.ini. One potential location is:

C:\xampp\apache\bin\php.ini


Well for Wamp User,

Go to: wamp\apps\phpmyadmin3.3.9\libraries

Under line 536, locate $cfg['ExecTimeLimit'] = 0;

and change the value from 0 to 6000. e.g

$cfg['ExecTimeLimit'] = 0;

To

$cfg['ExecTimeLimit'] = 6000;

Restart wamp server and phew.

It works like magic !


For Xampp version on Windows

Add this line to xampp\phpmyadmin\config.inc.php

$cfg['ExecTimeLimit'] = 6000;

And Change xampp\php\php.ini to

post_max_size = 750M 
upload_max_filesize = 750M   
max_execution_time = 5000
max_input_time = 5000
memory_limit = 1000M

And change xampp\mysql\bin\my.ini

max_allowed_packet = 200M

Changing php.ini for a web application requires restarting Apache.

You should verify that the change took place by running a PHP script that executes the function phpinfo(). The output of that function will tell you a lot of PHP parameters, including the timeout value.

You might also have changed a copy of php.ini that is not the same file used by Apache.


Go to xampp/php/php.ini

Find this line:

max_execution_time=30

And change its value to any number you want. Restart Apache.


ini_set('max_execution_time', 0); or create file name called php.ini and enter the first line max_execution_time=0 then save it and put the file in your root folder of your application.

That's it. Good luck.


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to database

Implement specialization in ER diagram phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' cannot be loaded Room - Schema export directory is not provided to the annotation processor so we cannot export the schema SQL Query Where Date = Today Minus 7 Days MySQL Error: : 'Access denied for user 'root'@'localhost' SQL Server date format yyyymmdd How to create a foreign key in phpmyadmin WooCommerce: Finding the products in database TypeError: tuple indices must be integers, not str

Examples related to xampp

Xampp localhost/dashboard phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user 'pma'@'localhost' (using password: NO) Is there way to use two PHP versions in XAMPP? Where to find htdocs in XAMPP Mac phpMyAdmin access denied for user 'root'@'localhost' (using password: NO) How to downgrade php from 7.1.1 to 5.6 in xampp 7.1.1? How to turn on/off MySQL strict mode in localhost (xampp)? mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it How to install mcrypt extension in xampp Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Examples related to execution-time

How to solve time out in phpmyadmin? How to increase maximum execution time in php Find out time it took for a python script to complete execution How do I get time of a Python program's execution? Maximum execution time in phpMyadmin calculating execution time in c++ What is the best way to measure execution time of a function? How do I time a method's execution in Java?