Fatal error: Maximum execution time of 30 seconds exceeded

后端 未结 16 787
逝去的感伤
逝去的感伤 2020-11-22 01:27

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

相关标签:
16条回答
  • 2020-11-22 01:34

    if all the above didn't work for you then 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>
    

    this was the way I solved my problem , neither ini_set('max_execution_time', 86400); nor set_time_limit(86400) solved my problem , but the .htaccess method did.

    0 讨论(0)
  • 2020-11-22 01:35

    All the answers above are correct, but I use a simple way to avoid it in some cases.

    Just put this command in the begining of your script:

    set_time_limit(0);
    
    0 讨论(0)
  • 2020-11-22 01:35

    I ran into 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.

    php_value max_execution_time 300  //where 300 = 300 seconds = 5 minutes
    
    0 讨论(0)
  • 2020-11-22 01:37

    I have make some changes in my case in: xampp\phpMyAdmin\libraries\config.default.php

    i have searched for : $cfg['ExecTimeLimit'] and change the value at right side...

    You can change Right hand Value to any higher value, like '5000'. and it works.

    0 讨论(0)
  • 2020-11-22 01:38

    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.

    0 讨论(0)
  • 2020-11-22 01:40

    Your script is timing out. Take a look at the set_time_limit() function to up the execution time. Or profile the script to make it run faster :)

    0 讨论(0)
提交回复
热议问题