PHP- cannot change max_execution_time in xampp

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

    You could also try setting ignore_user_abort(TRUE); in your script as it might be the browser timing out rather than the script.

    From the php.net manual

    <?php
    // Ignore user aborts and allow the script
    // to run forever
    ignore_user_abort(true);
    set_time_limit(0);
    

    See here for more info

    http://www.php.net/manual/en/function.ignore-user-abort.php

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

    In WAMP there is three PHP.ini files so you might find 3 in xampp also, so just search for it with find and replace max_execution_time to what you are setting. But you must keep something small not too large as for speedy the app you running.

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

    If you are on windows, and this is a CLI run script maybe read this.

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

    check phpinfo() from a temp script and search for max_execution_time. make sure that it has same value what you are setting. default should be 30 seconds. try to change it to a couple of different values and restart apache then check the value in phpinfo() to confirm.

    if when you change the value it is reflected properly in the phpinfo() it means that there is some code in your script which is changing this value. search for two things in your code:

    1. search your code for ini_set() and check if it is change max_execution_time
    2. search for set_time_limit()

    these functions can change maximum time limit of execution from script. otherwise you should check .htaccess from where this value may be set. but this will effect phpinfo() also.

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

    You have to change both of these in you php.ini ( and check if that's the right php.ini by finding the location in phpinfo(); output! )

    max_execution_time = 0
    max_input_time = 0
    

    And after that check if some php file is not overwriting those variables locally.

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