How to solve php mysql settings timeout problem

藏色散人
Release: 2023-03-03 08:24:01
Original
2489 people have browsed it

php Mysql setting timeout solution: first find and open the configuration file "php.ini"; then find the "mysql.connect_timeout" item in the file; finally modify the value to 2 or 3.

How to solve php mysql settings timeout problem

Recommended: "PHP Tutorial"

php connection mysql timeout problem

Phenomena:

When php establishes a connection with mysql, it waits for a long time, and finally reports that the script execution time exceeds the maximum value.

Source of the problem:

When PHP needs to connect to mysql, generally there will be no misconfiguration. If the machine where mysql is located is turned off, or there is a network problem, or the configuration is wrong, then you need to It will take a long time to know the result of the connection. The waiting time is determined by mysql.connect_timeout in php.ini (unit: seconds). It is recommended to set it to 2 or 3

The above is the detailed content of How to solve php mysql settings timeout problem. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!