Connection code
<?php
Echo ' a ';
$CN = mysql_connect ("localhost", ' your MySQL username ', ' your MySQL user password ') or Die (Mysql_error ());
if ($CN)
{
Echo Phpinfo ();
}
Else
{
echo ' MySQL connect fail ';
}
?>
Because the server is using a security php.ini where there is no error display, the Apache installation directory of the logs Errors.log log text
The item found the following error
PHP warning:php startup:unable to load Dynamic library
' D:myserverphpextphp_mysql.dll '-xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4xc4
Xa3xbfxe9xa1xa3rn in Unknown on line 0
PHP warning:php startup:unable to load Dynamic library
' D:myserverphpextphp_mysqli.dll '-xd5xd2xb2xbbxb5xbdxd6xb8xb6xa8xb5xc4
Xc4xa3xbfxe9xa1xa3rn in Unknown on line 0
[Tue Dec 31 09:05:15 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 2, referer:http://localhost/
[Tue Dec 31 09:05:16 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 2, referer:http://localhost/
[Tue Dec 31 09:05:17 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 2, referer:http://localhost/
[Tue Dec 31 09:06:04 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
[Tue Dec 31 09:06:05 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
[Tue Dec 31 09:06:05 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
[Tue Dec 31 09:06:05 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
[Tue Dec 31 09:06:06 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
[Tue Dec 31 09:06:06 2013] [ERROR] [Client 127.0.0.1] PHP Fatal error:call to undefined
function mysql_connect () in e:wwwa.php of Line 3, referer:http://localhost/
There's a phrase in the log
The PHP startup:unable to load Dynamic Library ' D:myserverphpextphp_mysql.dll ' means
The successful Php_mysql file has not been loaded, and there is a hint that the PHP Fatal error:call to undefined function
Mysql_connect (), this is a MySQL no connection success that is loading the MySQL library failed, according to the analysis of two possible one is the file does not
exists, this problem does not exist because I used to use this PHP extract package, 2 is the server environment variable problem, if the environment variable has two kinds of solutions
Decision
1, is directly in Windows to add environment variables
2, directly in the d:php find Php5ts.dll,libmysql.dll to copy it to the C:/winnt/system32 (winnt/2000 machine),
And the winxp/2003 is copied to the C:/windows/system32.