Access forbidden! You don't have permission to access the requested object. It is either read-pr

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Access forbidden! You don't have permission to access the requested object. It is either read-pr相关的知识,希望对你有一定的参考价值。

好久不没弄 apache和php了,突然遇到这种奇葩的问题,本来想直接在网上找现成的解决思路,结果网上搜索花了不少功夫,也没找到原因。

后来看日志文件:apache\logs\error.log发现了蛛丝马迹。

[core:error] [pid 200:tid 1704] (20024)The given path is misformatted or contained invalid characters: [client 127.0.0.1:51040] AH00127: Cannot map GET /.../%3C?%20echo%20$url%20?%3E HTTP/1.1 to file, referer:

讲 

%3C?%20echo%20$url%20?%3E
解码后,我心里就有数了。

<? echo $url ?>

大概是没有启用php的short_open_tag。

打开php\php.ini修改short_open_tag = On,重启apache,测试就没问题了。


以上是关于Access forbidden! You don't have permission to access the requested object. It is either read-pr的主要内容,如果未能解决你的问题,请参考以下文章

Access forbidden! You don't have permission to access the requested object. It is either read-pr

为啥 WAMP 会这样说:“Forbidden You don't have permission to access / on this server.”?

蛋疼的 403 Forbidden You don’t have permission to access / on this server.

HTTP错误:Forbidden You don't have permission to access …… on this server.

linux apache Forbidden You don't have permission to access / on this server.

MAMP "403 Forbidden You don't have permission to access / on this server."