<?php
//检测php是否正常
phpinfo();
//检测mysql是否正常
if(function_exists(mysql_connect)){
echo "support mysql<br>";
}else{
echo "sorry,mysql is not be supported<br>";
}
//检测php是否能联上mysql
$db=@mysql_connect("主机","帐号","密码") or die("Server is failed to connect!<br>");
@mysql_select_db("数据库名称",$db) or die("Database is failed to connect!<br>");
?>