On using ini_set('max_execution_time', 0);

后端 未结 3 1827
囚心锁ツ
囚心锁ツ 2020-12-30 05:40

How do I use ini_set(\'max_execution_time\', 0);?

Question 1: Do I place it at the top of the .PHP file or in a function that takes a

相关标签:
3条回答
  • 2020-12-30 06:19

    You can place it anywhere, but that setting won't take effect until it runs. So if you put it at the top, then the script will never timeout. If you put it down below on the function that can take awhile, then you may get a timeout above if the script takes a long time to get to where you called it.

    When you use ini_set() that option stays in effect for the entire execution of the script.

    0 讨论(0)
  • 2020-12-30 06:27

    Answer 1: before you execute the long-running code

    Answer 2: it lasts until the php process ends

    0 讨论(0)
  • 2020-12-30 06:38

    2: It only last for that page that loaded. after that its done.

    1: It should be placed at the start of the code, but it can be placed anywhere.

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