@H_4030@win7下手动搭建wamp环境,碰到的几个坑总结下:
@H403_0@1.能正常访问PHP和html类型文件,但是访问项目文件时老是连接被重置,后来总结是数据库的问题,就写测试用例测试PHP能否成功调用数据库。
<div class="jb51code">
<pre class="brush:PHP;">
<?php
echo "mysql";
$mysql_conf = array(
'host' => '127.0.0.1','db' => 'drupal628','db_user' => 'root','db_pwd' => 'admin',);
$MysqL_conn = @MysqL_connect($MysqL_conf['host'],$MysqL_conf['db_user'],$MysqL_conf['db_pwd']);
if (!$MysqL_conn) {
echo "失败";
die("could not connect to the database:\n" . MysqL_error());//诊断连接错误
}else{
echo "连接成功";
}
?>