You don’t have permission to access /index.php on.
程序员文章站
2022-06-13 19:51:23
今天在测试 php集成环境 apache服务器时,一切正常,在转换虚拟目录时,突然出现错误提示“you don't have permission to access /i...
今天在测试 php集成环境 apache服务器时,一切正常,在转换虚拟目录时,突然出现错误提示“you don't have permission to access /index.php on.“无论如何都不能正常浏览,再切换回原目录时,显示正常,只要切换虚拟目录,问题依旧。
其实这里是由于 httpd-conf 里面的配置问题,打开httpd-conf:逐行检查。在大约快一半的地方有以下这段代码:
<directory />
options followsymlinks
allowoverride none
order deny,allow
deny from all
</directory>
发现了吧。由于配置了php后,这里的“deny from all”已经拒绝了一切连接。把该行改“allow from all”,修改后的代码如下,问题解决。
<directory />
options followsymlinks
allowoverride none
order deny,allow
allow from all
</directory>
再次在浏览器里打开http://localhost,显示it works!
其实这里是由于 httpd-conf 里面的配置问题,打开httpd-conf:逐行检查。在大约快一半的地方有以下这段代码:
复制代码 代码如下:
<directory />
options followsymlinks
allowoverride none
order deny,allow
deny from all
</directory>
发现了吧。由于配置了php后,这里的“deny from all”已经拒绝了一切连接。把该行改“allow from all”,修改后的代码如下,问题解决。
复制代码 代码如下:
<directory />
options followsymlinks
allowoverride none
order deny,allow
allow from all
</directory>
再次在浏览器里打开http://localhost,显示it works!
推荐阅读
-
You don’t have permission to access /index.php on.
-
对于搭建网站中出现“You don't have permission to access this resource.”错误提示的解决思路
-
You don't have permission to access / on this server,Forbidden
-
CentOS7.0下安装Apache2.4.20版本,安装完成之后,报 You don't have permission to access / on this server.
-
wamp不能使用phpmyadmin,提示“You don't have permission to access /phpmyadmin/ on this server.”...
-
Apache启动后出现You don't have permission to access on this server的解决办法
-
PHP错误:Forbidden You don't have permission to access / on thi_PHP教程
-
apache出现You don't have permission to access / on thi_PHP教程
-
Apache出现 You don't have permission to access /phpmya
-
wamp不能使用phpmyadmin,提示“You don't have permission