Install and configure Wamp, Apache 2.2.15 32-bit, php5.3.2 32-bit, and mysql5.5.2 64-bit on win7 64-bit. What is depressing is that all tests are OK, but they cannot connect to the database. At first they thought it was a time zone problem, so they modified PHP. INI data. timezone = PRC, the problem persists, and I found a post on the Internet that is the same as my problem. According to the method, the problem is indeed true, and the hosts has been modified for anti-Photoshop verification. The network is really a good thing!
Text from http://blog.sina.com.cn/s/blog_4ab014680100h59k.html
Warning: mysql_connect () [function. mysql-connect]: [2002] A connection attempt failed because the connected party did not (trying to connect via TCP: // localhost: 3306) in E: /Apache/www/MySQL. PHP on line 20 warning: mysql_connect () [function. mysql-connect]: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in E:/Apache/www/MySQL. PHP on line 20
Fatal error: Maximum execution time of 60 seconds exceeded in E:/Apache/www/MySQL. php on line 20
Recently, PHP was used in Windows 7 and encountered a very difficult problem. When phpMyAdmin was used to manage the MySQL database, an unknown error occurred and the database could not be connected for a long time, even if you use setup to configure phpMyAdmin, it cannot be loaded normally. However, it is strange that you can connect to it using mysqladministrator GUI tools. The problem is the same. I checked a lot of information for a long time to understand the problem? I hope to help you solve this problem today!
The solution is as follows:
First, check whether port 3306 is occupied. But if mysqladministrator GUI tools can manage the MySQL database, it should not be a port problem. Then, check whether the problem is caused by localhost. The result is in C: in the/Windows/system32/Drivers/etc/hosts file, localhost is not defined by default. #127.0.0.1 localhost is commented out, so remove, run again, OK! Everything is normal, and phpMyAdmin can be used normally.
I hope that friends who are confused about this problem can bring you the gospel of solution! We also hope to share our learning progress with you.