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
If above answers will not work, try to check your code,,In my experience,having an infinite loop will also cause that problem.Check your else if statement.
WAMP USERS:
1) Go to C:\wamp\apps\phpmyadmin
2) Open config.inc
3) Add $cfg['ExecTimeLimit'] = ’3600′; to the file.
4) Save the file and restart the server.
This file overwrites the php.ini and will work for you!
MAMP USERS editing php.ini solves this - there is a line:
max_execution_time = 30 ; Maximum execution time of each script, in seconds
setting this to a higher value worked.
the file is in php/php5.6.25/conf/php.ini (obviousl you need to wet the file for the php version you are using - you can find this out from the MAMP preferences.
I encountered a similar situation, and it turns out that Codeigniter (the PHP framework I was using) actually sets its own time limit:
In system/core/Codeigniter.php, line 106 in version 2.1.3 the following appears:
As there was no other way to avoid changing the core file, I removed it so as to allow configuration through php.ini, as well as give the infinite maximum execution time for a CLI request.
I recommend recording this change somewhere in the case of future CI version upgrades however.
This is the the right answer:
go to
find and set
restart all services and done.
For Local AppServ
Go to C:\AppServ\www\phpMyAdmin\libraries\config.default.php
Find
$cfg['ExecTimeLimit']
and set value to 0.So it'll look like