In an old php project, after the php version is upgraded to 5.4.x, the request response becomes slow. In firebug, check that the wait time for the response is greater than 1 s. In the local test environment, the project is not large, there is very little data and there should be no such slow response speed. It is important that the same code works normally before php is upgraded, and the response time is not so long. Upgraded
In an old php project, after the php version is upgraded to 5.4.x, the request response becomes slow. In firebug, check that the wait time for the response is greater than 1 s. In the local test environment, the project is not large, there is very little data and there should be no such slow response speed. It is important that the same code works normally before php is upgraded, and the response time is not so long. Upgraded
In an old php project, after the php version is upgraded to 5.4.x, the request response becomes slow. In firebug, check that the wait time for the response is greater than 1 s. In the local test environment, the project is not large, there is very little data and there should be no such slow response speed. It is important that the same code works normally before php is upgraded, and the response time is not so long. The upgraded performance cannot be worse.
It has been verified that it is related to ipv4 and ipv6. PHP 5.3 and later versions detect ipv4 or ipv6 when encountering localhost, so the response time is too long.
The configuration related to database connections in the project is usually defined in this way.
// MySQL server address
Define ("dbserver", "localhost ");
In many cases, our web server and database server are the same computer, so they are set to localhost, which is the cause of slow response.
The solution is simple. You can replace localhost with 127.0.0.1, so that it is clear that it is an ipv4 address, without the time and effort of php over there.
Define ("dbserver", "127.0.0.1 ");
Let's see if our website is flying fast.
Related Articles
This article from: http://flyash.itcao.com, original address: http://www.itcao.com/post_1266.html, thanks to the original author to share.