我們使用http://localhost/test.php進行本機測試,沒有發現問題,在內網測試時,使用IP位址進行訪問,如:http:// 10.10.50.195/test.php,就出現了403錯誤這個問題。解決這個問題的方法如下:
1、先修改一下php的設定檔httpd.conf
在原有的位置檔中找到組態節
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all Satisfy all </Directory>
修改成
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow # Deny from all Allow from all #允许所有访问 Satisfy all </Directory>
還有
<Directory "D:/Wamp5/www"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff from this server. # # onlineoffline tag - don't remove Order Deny,Allow Deny from all Allow from 127.0.0.1 </Directory>
修改成
<Directory "D:/Wamp5/www"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.2/mod/core.html#options # for more information. # Options Indexes FollowSymLinks # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride all # # Controls who can get stuff from this server. # # onlineoffline tag - don't remove Order Deny,Allow # Deny from all # Allow from 127.0.0.1 Allow from all </Directory>
2、然後儲存,重啟服務,再存取就解決了這個問題。
更多PHP相關知識,請造訪PHP中文網!
以上是php403錯誤的詳細內容。更多資訊請關注PHP中文網其他相關文章!