I keep getting this PHP error:
Fatal error: Maximum execution time of 300 seconds exceeded
I have tried setting my max_execution_time
and my max_input_time
settings in php.ini (both apache and cli) to 0
, -1
and 4000
seconds each.
And i still get the error saying:
Fatal error: Maximum execution time of 300 seconds exceeded
As well my script runs over 300 seconds before i get this message
I am running the script through command line.
I also checked my phpinfo()
so see which php.ini
I am using.
Even more interesting I have tried setting max_execution_time
and max_input_time
settings to 5 second and my script will run way beyond 5 seconds before I get the:
Fatal error: Maximum execution time of 300 seconds exceeded
At the beginning of your script you can add.
In Codeignitor version 3.0.x the system/core/Codeigniter.php do not contain the time constraint as well as inserting
will not work since codeignitor will override that with its own function set_time_limit() . So either you have to delete that function from codeignitor or simply you can insert
in the beginning of the php file if you wanna change that to 1000 seconds. Set the time to 0 (zero) if you want to run it as long as it want.
If you are using WAMP Go to :
Increase the
max_execution_time
inphp.ini
then go toC:\wamp\apps\phpmyadmin3.4.10.1\libraries
(change path according to your installation)open
config.default.php
and change value for$cfg['ExecTimeLimit']
to 0:This will resolve the issue for PhpMyAdmin imports.
If you are on xampp and using phpMyadmin to import large sql files and you have increased max_execution time, max file upload limit and everything needed And If none of the above answers work for you come here
Go to your xampp folder, in my case here is the relative path to the file that I need to modify: C:\xampp\phpMyAdmin\libraries\config.default.php
/** * maximum execution time in seconds (0 for no limit) * * @global integer $cfg['ExecTimeLimit'] * by defautlt 300 is the value * change it to 0 for unlimited * time is seconds * Line 709 for me */ $cfg['ExecTimeLimit'] = 0;
In my case, when I faced that error in Phpmyadmin, I tried MySQL-Front and import my DB successfully.
Note: You can still use the provided solutions under this question to solve your problem in Phpmyadmin.
On Xampp, in php.ini you must check mysql.connect_timeout either. So, for example, change it to:
That time will be always counted in seconds (so 1 hour in my example)