Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal error: Maximum execution time of 30 seconds exceeded

Tags:

json

php

I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error:

Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\temp\fetch.php on line 24

like image 815
Harsha M V Avatar asked Mar 02 '11 08:03

Harsha M V


People also ask

How do you fix maximum execution time of 60 seconds exceeded?

You can change '600' to any higher value, like '6000'. Maximum execution time in seconds is (0 for no limit). This will fix your error.


2 Answers

Your loop might be endless. If it is not, you could extend the maximum execution time like this:

ini_set('max_execution_time', '300'); //300 seconds = 5 minutes

and

set_time_limit(300); 

can be used to temporarily extend the time limit.

like image 144
Michiel Pater Avatar answered Oct 13 '22 09:10

Michiel Pater


I had the same problem and solved it by changing the value for the param max_execution_time in php.ini, like this:

max_execution_time = 360      ; Maximum execution time of each script, in seconds (I CHANGED THIS VALUE) max_input_time = 120          ; Maximum amount of time each script may spend parsing request data ;max_input_nesting_level = 64 ; Maximum input variable nesting level memory_limit = 128M           ; Maximum amount of memory a script may consume (128MB by default) 

I hope this could help you.

like image 21
Güilber J. Castillo Avatar answered Oct 13 '22 09:10

Güilber J. Castillo