3

I have changed php.ini settings and max timeout in http-default.conf under apache but still I get the following error:

Maximum execution timeout of 300 seconds

I have even added set_time_limit and ini_set to the php script but still I get this error.

How do I resolve this?

Note:

I tried the options in Fatal error: Maximum execution time of 300 seconds exceeded.

Community
  • 1
  • 1
Shan
  • 2,822
  • 9
  • 40
  • 61
  • Do you happen to be on a shared host provider that prevents setting the maximum execution higher? Also check if any PHP files are being unintentionally loaded in via `auto_prepend_file`. – Dave Chen Apr 10 '15 at 03:12
  • Maybe you should just make a php info file with code like: `` and check what the timeout is set to? Next check which ini file it's actually using etc etc – icecub Apr 10 '15 at 03:16
  • The first rule in programming (and pc issues in general) is debugging and getting information instead of just changing stuff and hope for the best! Get PHP to tell you what its settings are, which ini file it's loading, stuff like that. If you know what it's doing you also know where to actually fix it. – icecub Apr 10 '15 at 03:22
  • I have got the info from phpinfo too..and I have set both too to 86400 but the script is getting timed out at 300 seconds – Shan Apr 10 '15 at 03:26
  • Does phpinfo tell you the timeout is set to 86400 seconds? – icecub Apr 10 '15 at 03:27
  • yes it has..I am able to see master as local values as 86400 – Shan Apr 10 '15 at 03:33

4 Answers4

6

Change Maximum Execution Time

php.ini

max_execution_time = 30

From Code

Start your code with,

ini_set('MAX_EXECUTION_TIME', 3600);

.htaccess

php_value max_execution_time 3600

No matter which option you choose, restart Apache service.

Leandro Papasidero
  • 3,728
  • 1
  • 18
  • 33
2

use below thing and i think will work

set_time_limit(0);
juco
  • 6,331
  • 3
  • 25
  • 42
bob_1982
  • 715
  • 6
  • 16
2

Conditions:

If you are 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 server (xampp or wamp) 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;
Noor Ahmed
  • 178
  • 12
0

In php.ini you must check mysql.connect_timeout either. So, for example, change it to:

mysql.connect_timeout = 1000

That time will be always counted in seconds

andymnc
  • 103
  • 7