I,
Remove the ";" before the following parameters in PHP. ini:
Copy codeThe Code is as follows:
; Extension = php_dba.dll
; Extension = php_gd2.dll
; Extension = php_mbstring.dll
; Extension = php_mcrypt.dll
; Extension = php_mysql.dll
; Extension = php_mysqli.dll
; Extension = php_pdo.dll
; Extension = php_pdo_mysql.dll
Save the file and restart IIS
Description
In php. ini
; Extension = php_mysql.dll
Change
Extension = php_mysql.dll
Extension_dir = ""
Change
Extension_dir = "ext /"
Copy libmysql. dll to system32 and restart later.
Test whether php mysql can be connected
<? Php
$ Link = mysql_connect ('localhost', 'root', '123 ');
If (! $ Link) echo "fail ";
Else echo "success ";
Mysql_close ();
?>
II,
1. Check whether mysql exists in php_info () (search for the "mysql" keyword). If any, it may be caused by version compatibility problems.
2. if you do not set libmysql in the PHP file. dll copy to x: windowssystem32 to copy php. remove extension = php_mysql.dll from the comment of the mysql module in ini to restart apache. If not, restart the machine and try to test the function using php_info.
Right-click my computer> Properties> advanced> environment variables> system environment variables
A. Select Path in "system environment variables" to make the line highlighted. Then select "edit" and add "; D: \ php#(php.exe directory) at the end of the variable value)
B. "system environment variables"-> "new"-> variable name "PHPRC"-> variable value "D: \ php" (directory of php. ini)->
2. view the PhpIniDir settings in the httpd. conf file to point to the Php Directory.
3. Try to change PhpIniDir = "C:/Php" in httpd. conf to PhpIniDir = "C: \ Php ".