PHP5.3.andPHP5.4. slow connection to Mysql in Windows
Source: Internet
Author: User
PHP5.3. * andPHP5.4. * connection to Mysql is slow in Windows. after judgment, I think it is a problem of VC9 Compilation. PHP5.2.17 compiled by VC6 is very fast and the same simple query, PHP5.2.17 of VC6 takes more than 6 Hao seconds, while 5.3 and 5.4 compiled by VC9 in later versions take more than two seconds. PHP5.3. * and PHP5.4. * slow connection to Mysql in Windows
For example, after judgment, I think it is the issue of VC9 Compilation. the PHP5.2.17 compiled by VC6 is very fast. in the same simple query, PHP5.2.17 of VC6 takes more than 6 Hao seconds, in the later versions of VC9, the compilation of 5.3 and 5.4 took more than two seconds. It is enough to prove that PHP compiled by VC9 has problems working under Apache.
I wrote Apache2 compiled by VC9.
Is there a solution to this problem?
------ Solution --------------------
I also encountered execution efficiency issues. after testing and troubleshooting, the compilation version has nothing to do with mysqlnd. In fact, the solution is very simple, as shown below:
"$ Dbhost = 'localhost'" in the database connection statement '"
Change to "$ dbhost = '192. 0.0.1 '"
This is because "localhost" exists in both IPv6 and IPv4, resulting in conflicts.
------ Solution --------------------
Discussion
I also encountered execution efficiency issues. after testing and troubleshooting, the compilation version has nothing to do with mysqlnd. In fact, the solution is very simple, as shown below:
"$ Dbhost = 'localhost'" in the database connection statement '"
Change to "$ dbhost = '192. 0.0.1 '"
This is because "localhost" exists in both IPv6 and IPv4, resulting in conflicts.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service