Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server


好久不沒弄 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,測試就沒問題了。



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM