PHP- cannot change max_execution_time in xampp

前端 未结 11 849
再見小時候
再見小時候 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: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.

提交回复
热议问题