I,
Remove the ";" before the following parameters in PHP. ini:
CopyCode The 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
PHP. in INI, set
; extension = php_mysql.dll
changed to
extension = php_mysql.dll
extension_dir = ""
changed to
extension_dir = "ext/"
libmysql. copy the DLL to system32 and then restart it.
test whether PHP MySQL can be connected.
$ link = mysql_connect ('localhost', 'root', '123');
If (! $ Link) echo "fail";
else echo "success";
mysql_close ();
?>
2.
1. php_info () check whether there is a MySQL item (search for the "MySQL" keyword). If there is a possible version compatibility problem
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 and choose Properties> advanced> environment variables> system environment variables
. select path in "system environment variables" to make this 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" (PHP. INI directory)->
2. check httpd. set phpinidir In the conf file to point to the PHP Directory.
3. Try changing phpinidir = "C:/PHP" in httpd. conf to phpinidir = "C: \ PHP ".