Home  >  Article  >  Backend Development  >  What is the way to make php time out?

What is the way to make php time out?

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-27 09:42:422724browse

What is the way to make php time out?

3 ways to set php timeout:

The first way is to open the php.ini file, find max_execution_time, and change the following numbers. into the time you want, in seconds.

After modification in this way, the service needs to be restarted. This method is generally not recommended.

Related recommendations: "PHP Tutorial"

Second, use PHP's ini_set() function setting, setting method:

ini_set("max_execution_time",1800);

The setting statement must be the first line of the php file.

The third method is to use PHP's set_time_limit() function to set it. Setting method:

set_time_limit(1800);

The setting statement must be the first line of the PHP file.

The above is the detailed content of What is the way to make php time out?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn