How to modify the php.ini timeout: 1. Find the php.ini file, then find the "max_execution_time= 30;" item and modify the parameters; 2. Use the "ini_set()" function to change the maximum execution time limit value ;3. Use the "set_time_limit()" function to add 10 seconds to the maximum execution time.
The operating environment of this tutorial: Windows 10 system, PHP version 8.1, DELL G3 computer
How to modify the php.ini timeout problem ?
Three ways to deal with PHP execution timeout
There are three ways to solve PHP execution timeout:
1. Modify php Configuration file, find the php.ini file, and then find max_execution_time= 30; //Set to the value you want, the unit is seconds
This line, this is the maximum execution time set to 30 seconds. You can modify this value to your expected value.
(You can also set it directly to: max_execution_time= 0)
2. Use the ini_set() function, use this function to change your maximum execution time limit value
For example :ini_set('max_execution_time','50');
is set to 50 seconds, you can also set it to 0, then the execution time is not limited.
3. Use the set_time_limit() function, set_time_limit(10), which means the maximum execution time plus 10 seconds, but if PHP is executing in safe mode, set_time_limit() will have no results.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to modify php.ini timeout problem. For more information, please follow other related articles on the PHP Chinese website!