One
The ";" in front of the following parameters in the php.ini Remove:
Copy the Code code 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, restart IIS
Specific instructions
PHP.ini inside the
; Extension=php_mysql.dll
Change into
Extension=php_mysql.dll
Extension_dir = ""
Change into
Extension_dir = "ext/"
And then copy the Libmysql.dll to System32 and then reboot.
Test if PHP MySQL can connect
$link =mysql_connect (' localhost ', ' root ', ' 123456 ');
if (! $link) echo "fail";
else echo "Success";
Mysql_close ();
?>
Two
1.php_info () Check if there is a MySQL (search "mysql" keyword), if it is possible version compatibility issues
2. If you do not copy the PHP file in the Libmysql.dll to x:windowssystem32 the php.ini in the MySQL module to remove the comments Extension=php_mysql.dll restart Apache if not yet Reboot the machine try the test using Php_info ().
Right-click My Computer, properties, high-level environment variable, system environment variables
A. In system environment variables, select Path to highlight the line, and then select Edit to Add ";D: \php" At the end of the variable value (Php.exe directory)
B. Variable name "PHPRC", "New", "System environment variable", "D:\php" (php.ini directory)
2. Look at the settings of the Phpinidir in the httpd.conf file to point to the PHP directory.
3. Try to change the phpinidir= "c:/php" in httpd.conf to Phpinidir= "C:\PHP".
The above describes the defined IIS under the PHP connection database hint MySQL undefined function mysql_connect, including the defined aspects of the content, I hope to be interested in PHP tutorial friends helpful.