复制以下代码粘贴至conn_mysql.php文件,把“你的密码”改成你的mysql密码
<?php
$connection = mysql_connect ("localhost","root","你的密码");
mysql_select_db ("mysql");
if($connection){
echo "<script>alert('数据库连接正常');</script>";
}
else{
echo "<script>alert('数据库连接失败,请检mysqle服务是否启动');</script>";
}
?>在浏览器里输入:http://127.0.0.1/conn_mysql.php后失败
显示:Not FoundThe requested URL /conn_mysql.php was not found on this server.
这是怎么回事,本人是菜鸟,求大侠们知道。
<?php
$connection = mysql_connect ("localhost","root","你的密码");
mysql_select_db ("mysql");
if($connection){
echo "<script>alert('数据库连接正常');</script>";
}
else{
echo "<script>alert('数据库连接失败,请检mysqle服务是否启动');</script>";
}
?>在浏览器里输入:http://127.0.0.1/conn_mysql.php后失败
显示:Not FoundThe requested URL /conn_mysql.php was not found on this server.
这是怎么回事,本人是菜鸟,求大侠们知道。
解决方案 »
- php的pack与unpack函数的使用
- Xajax 的问题!!!!!!!!!帮忙!!急
- php新手问题
- 一段简单的PHP嵌套html的代码,php是按如何的顺序执行的啊?
- 正则表达式中关于.和*的小问
- 如果Apache坏了,从来开始检查.......................一直等待....
- 初学PHP,问一个菜鸟问题,请大家不要吝啬,谢谢
- IIS的权限问题,又上传不了文件了?
- php 目录迭代器 RecursiveDirectoryIterator 如何提高效率
- 加载数据问题
- 如何从数据库中取出多条数据
- php socket_recv出现错误,unable to read socket[0]:操作成功完成
检查网站根目录下是否有 conn_mysql.php文件
按照这个一步一步配置就可以了。
搞不好 php都还没支持...哈哈
[Sun Apr 29 13:44:07 2012] [notice] Apache/2.2.22 (Win32) PHP/5.2.17 configured -- resuming normal operations
[Sun Apr 29 13:44:07 2012] [notice] Server built: Jan 28 2012 11:16:39
[Sun Apr 29 13:44:07 2012] [notice] Parent: Created child process 7676
[Sun Apr 29 13:44:07 2012] [notice] Child 7676: Child process is running
[Sun Apr 29 13:44:07 2012] [notice] Child 7676: Acquired the start mutex.
[Sun Apr 29 13:44:07 2012] [notice] Child 7676: Starting 64 worker threads.
[Sun Apr 29 13:44:07 2012] [notice] Child 7676: Starting thread to listen on port 80.
[Sun Apr 29 13:44:12 2012] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Apr 29 13:44:12 2012] [notice] Apache/2.2.22 (Win32) PHP/5.2.17 configured -- resuming normal operations
[Sun Apr 29 13:44:12 2012] [notice] Server built: Jan 28 2012 11:16:39
[Sun Apr 29 13:44:12 2012] [notice] Parent: Created child process 5868
[Sun Apr 29 13:44:12 2012] [notice] Child 5868: Child process is running
[Sun Apr 29 13:44:12 2012] [notice] Child 5868: Acquired the start mutex.
[Sun Apr 29 13:44:12 2012] [notice] Child 5868: Starting 64 worker threads.
[Sun Apr 29 13:44:12 2012] [notice] Child 5868: Starting thread to listen on port 80.
[Sun Apr 29 13:44:22 2012] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Apr 29 13:44:23 2012] [notice] Apache/2.2.22 (Win32) PHP/5.2.17 configured -- resuming normal operations
[Sun Apr 29 13:44:23 2012] [notice] Server built: Jan 28 2012 11:16:39
[Sun Apr 29 13:44:23 2012] [notice] Parent: Created child process 7028
[Sun Apr 29 13:44:23 2012] [notice] Child 7028: Child process is running
[Sun Apr 29 13:44:23 2012] [notice] Child 7028: Acquired the start mutex.
[Sun Apr 29 13:44:23 2012] [notice] Child 7028: Starting 64 worker threads.
[Sun Apr 29 13:44:23 2012] [notice] Child 7028: Starting thread to listen on port 80.
这是error.log内容,在浏览器里输入:http://127.0.0.1/conn_mysql.php后网页还是打不开
phpinfo();
?>然后看看是否正常
phpinfo();
?>
正常