It is strange to build a PHP environment in win7sp1, and PHP cannot connect to mysql.
Source: Internet
Author: User
Win7sp1: set up the PHP environment. PHP cannot connect to mysql. it is strange that the reason cannot be found. my local mysql can be completely connected under cmd to create a database and a data table. everything is normal, but it won't work if you use PHP to connect. let's talk about my environment win7sp1 & nbsp; 64 & nbsp;, php5.2.5 & nbsp; apac win7 sp1 to build a PHP environment. it's strange that PHP cannot connect to mysql.
I can't find the reason. my local mysql can be fully connected under cmd, creating a database and a data table. everything is normal, but it won't work if I use PHP to connect. let's talk about my environment first.
Win7sp1 64, php5.2.5 apache2.2
Php and apache have been integrated. The final configuration of APACHE is as follows:
However, there is no mysql information in phpinfo. I found it myself, and some said it was a HOST file problem. I added 127.0.0.1 to localhost, and then installed it on a virtual machine. PHP. INI has enabled mysql and mysqli modules. I don't know where the problem is.
If mysql_connect () is used for connection, a problem occurs in the mysql_connect function.
In PHP, the location of EXT is correct. the EXT directory also contains the php_mysql.dll file. please help me analyze what the problem will be. thank you very much. Share:
------ Solution --------------------
Remove the mysql entry from the environment variable, or insert the php path to the mysql entry.
------ Solution --------------------
Don't use 5.25 anymore ....
You have a complete installation package.
Http://www.apachefriends.org/zh_cn/xampp.html
I will try to configure this environment later.
------ Solution --------------------
If php fails to load the mysql extension Library, the message mysql_connect () is not defined.
Try to copy the php_mysql.dll and libmysql. dll files to c: \ winnt \ system32.
Refer
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.