- When downloading a JSON file from an online source and it runs through the loop getting this error:
- Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\temp\fetch.php on line 24
- Your loop might be endless. If it is not, you could extend the maximum execution time like this:
[ad type=”banner”]
- we solved it by changing the value for the param max_execution_time in php.ini, like this:
- Just put this command in the begining of your script:
- Edit php.ini
- Find this line:
- Change its value to 300:
- 300 means 5 minutes of execution time for the http request.
- In this problem while upgrading to WordPress 4.0. By default WordPress limits the maximum execution time to 30 seconds.
- Add the following code to your .htaccess file on your root directory of your WordPress Installation to over-ride the default.
- You add an .htaccess file to the directory where your script is located and put this inside
- Neither ini_set(‘max_execution_time’, 86400); nor set_time_limit(86400) solved my problem , but the .htaccess method did.
- Neither ini_set(‘max_execution_time’, 86400); nor set_time_limit(86400) solved my problem , but the .htaccess method did.
- You can remove the restriction by setting it to zero by adding this line at the top of your script:
- Follow the path /etc/php5(your php version)/apache2/php.ini.
- Open it and set the value of max_execution_time to a desired one.
We can solve this problem in 3 different ways.
- Using php.ini file
- Using .htaccess file
- Using Wp-config.php file ( for WordPress )