PHP- cannot change max_execution_time in xampp

前端 未结 11 847
再見小時候
再見小時候 2021-01-18 00:42

I\'ve tried everything to change the max_execution_time of a php crawler script so that it can run an infinite amount of time.

I have changed the php.in

相关标签:
11条回答
  • 2021-01-18 01:05

    I found the following in the xampp documentation. Maybe you are trying to edit the wrong php.ini file?

    Why have changes in my php.ini no effect?

    Since XAMPP 1.7.1 the "php.ini" is only in the directory "\xampp\php". Till XAMPP 1.7.0 is was in the directory "\xampp\apache\bin".

    If a change in the "php.ini" have no effect, it's possible PHP is still using an other one. You can verify this with phpinfo(). Go to the URI localhost/xampp/phpinfo.php and search for "Loaded Configuration File". This value shows you the "php.ini" PHP is really using.

    Info: After changing the "php.ini" you have to restart Apache, thus Apache/PHP can read the new settings.

    0 讨论(0)
  • 2021-01-18 01:06

    use

    set_time_limit(0);
    

    at the top of the script

    0 讨论(0)
  • 2021-01-18 01:06

    open php.ini notepad file and search or find upload_max_filesize = 1000M and you should change on Post_max_filesize = 1000M then restart your xampp and refresh the local phpmyadmin..

    0 讨论(0)
  • 2021-01-18 01:09

    what you are doing is just setting the max_execution_time to whatever inside your page. you can't change this using ini_set. you can change the memory_limit only.

    see more details here... from the php official site.

    if you want them to be changed, change in php.ini.

    0 讨论(0)
  • 2021-01-18 01:12

    You shouldn't let your crawler run under apache, it's better to run it stand-alone via cli as part of a Gearman setup.

    That way it won't hog your web server and it can run as long as you want. You can find many bindings for Gearman that you can use, including PHP of course.

    0 讨论(0)
  • 2021-01-18 01:15

    Try turning off safe mode in php and then try the below code

    if( !ini_get('safe_mode') ){ 
        set_time_limit(0); //this won't work if safe_mode is enabled.
    }
    

    This should allow you to run the script for infinite time.

    In Apache you can change maximum execution time by .htaccess with this line

    php_value max_execution_time 200
    

    set_time_limit() php manual ref.

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