配置網站後訪問出現以下提示
禁止訪問!
您無權訪問所請求的目錄。 這是由於沒有主頁或該目錄不允許被讀取導致的。
如果您認爲這是一個服務器錯誤,請聯繫網站管理員。
Error 403
localhost
Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.29
-
解決方案
-
查看文件權限
-
修改Apache配置文件httpd.conf中關於目錄訪問權限設置
# # Deny access to the entirety of your server's filesystem. You must # explicitly permit access to web content directories in other # <Directory> blocks below. # <Directory /> AllowOverride none Require all denied </Directory> #增加自定義項 <Directory "F:/"> AllowOverride All Require all granted </Directory>
-
如果仍未解決還需關閉selinux,重啓生效
-