PHP Fatal error: Maximum execution time of 60 seconds exceeded

When I try to run a php function, which contain several sub function that include loop to retrieve data from website and update it to mysql. I have received the following error.
“Fatal error: Maximum execution time of 60 seconds exceeded “

This error occurs because this function has been execute longer than the maximum execution time.

To resolve this issue you can update the following.
1) In php.ini.
You can find the following string on the php.ini. And update the maximum execution time according to the time that you need.
“max_execution_time = 60     ; Maximum execution time of each script, in seconds”

2) you can execute the following code before you run that function.
set_time_limit(TimeInSecond); //I’ve used 0 e.g. set_time_limit(0); in my case, as I am running it on my computer.

Hope you find this useful.

Happy programming =)

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.