Win7 SP1 to build PHP environment, PHP is not connected to MySQL, very strange

Source: Internet
Author: User
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
  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.