Win7 SP1 build PHP environment, PHP is not connected to MySQL, very strange
Can't find the reason Ah, my local MySQL can be fully connected under CMD, new database, data table, everything is OK, but with PHP connection is not, first say my environment
WIN7SP1, php5.2.5 apache2.2
PHP and Apache have been integrated, and the final configuration of Apache is this
LoadModule php5_module "D:/service/php/php5apache2_2.dll"
Phpinidir "d:/service/php"
AddType application/x-httpd-php. php
But phpinfo inside no MySQL information, I found the next, and some said the host file problem, I added 127.0.0.1 to localhost is the same, and then with the virtual machine installation is the same, PHP. INI has started the MySQL and mysqli modules, I don't know where the problem is.
Then use Mysql_connect () to connect the hint mysql_connect This function problem, it should be this meaning
PHP inside ext position is also right, ext directory also has php_mysql.dll file, please Daniel help me to analyze the problem will be out where, thank you very much.
Share to:
------Solution--------------------
Remove the MySQL entry in the environment variable, or insert the PHP path in front of the MySQL item
------Solution--------------------
Don't use the 5.25.
Just a complete installation package.
Http://www.apachefriends.org/zh_cn/xampp.html
Let's toss this environment configuration later.
------Solution--------------------
PHP failed to load MySQL extension library before prompting mysql_connect () not defined
Try copying the Php_mysql.dll and Libmysql.dll files to the C:\Winnt\System32
See below