In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to modify the execution time of php script". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to modify the execution time of php script".
There are three methods: 1. Open the "php.ini" file and modify the value of the "max_execution_time" item. 2. Use "ini_set (" max_execution_time "," new value ");" modify. 3. Modify with "set_time_limit (new value);".
Operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
The php script execution time is related to whether the script runs out of time. The maximum execution time of the php script is 30 seconds.
If the script needs to run for a long time, such as sending a large number of emails, or analyzing a large amount of data to prevent the server from forcibly aborting the program in progress after 30 seconds, change the maximum execution time of the php script.
So how do I change the execution time of php scripts?
Here are three methods:
1. Set it in php.ini
In the php.ini configuration file, the script execution time is specified by the max_execution_time variable. So you just need to set the value of the variable.
Max_execution_time = new numeric value
2. Set it through the ini_set function of PHP
Ini_set is used to set the value of php.ini, which takes effect when the function is executed, and the setting becomes invalid after the end of the script. You can modify the configuration without opening the php.ini file, which is convenient for virtual spaces.
Just use the ini_set function to modify the value of the max_execution_time variable
Ini_set ("max_execution_time", "new value")
3. Set through the set_time_limit function
The set_time_limit function is used to limit the execution time of a page
Set_time_limit (new value)
Description:
In the above three methods, if the value is set to 0, there is no limit, and the script executes until the end of execution.
Therefore, for scripts that need to be executed for a long time, you can usually add the following code at the beginning of the php code
Set_time_limit (0): thank you for reading, the above is the content of "how to modify the execution time of php script", after the study of this article, I believe you have a deeper understanding of how to modify the execution time of php script, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.