最近在学习 PHP,搭建环境后,在 Safari 能打开 http://localhost,显示 It works!
接着改动了 DocumentRoot 的地址为 Sites 文件的地址(“/Users/用户名/Sites”),让后创建新 php 文件,能在 Safari 中通过 http://localhost/xxx.php
可后来就不能打开了,只能打开 http://localhost,显示 It works!
这是怎么回事?是哪里配置出错了吗?
只改DocumentRoot路径是不行的 还要修改一下 DocumentRoot Directory下的访问权限。
请确保DocumentRoot 更改正确
修改配置后有没有重启httpd服务?
推荐具体博客:http://blog.csdn.net/hanrovey/article/details/51544236