[Solved-4 Solutions] Fatal error: Maximum execution time of 30 seconds exceeded



Error Description:

    • We download a JSON file from an online source and when it runs through the loop we get this error:

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

    Solution 1:

    • The loop might be endless. If it is not, we could extend the maximum execution time like this:
    ini_set('max_execution_time', 300); //300 seconds = 5 minutes
    
    click below button to copy the code. By - php tutorial - team

    Solution 2:

    • Just put this command in the beginning of the script:
    set_time_limit(0);
    
    click below button to copy the code. By - php tutorial - team

    Solution 3:

    • Add an .htaccess file to the directory where your script is located and put this inside:
    <IfModule mod_php5.c>
    php_value post_max_size 200M
    php_value upload_max_filesize 200M
    php_value memory_limit 300M
    php_value max_execution_time 259200
    php_value max_input_time 259200
    php_value session.gc_maxlifetime 1200
    </IfModule>
    
    click below button to copy the code. By - php tutorial - team

    Solution 4:

    • 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.

    Related Searches to Fatal error: Maximum execution time of 30 seconds exceeded