Xampp禁止访问php [英] Xampp Access Forbidden php
问题描述
我是Windows用户.我已经使用xampp已有一段时间了,但是突然我的.php文件现在都无法正常工作了! 我收到此错误消息:
I'm a windows user. I've been using xampp for quite a while but suddenly none of my .php files are working now! I get this error message:
禁止访问!
您无权访问所请求的对象.服务器已对其进行了读保护或不可读.
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
如果您认为这是服务器错误,请与网站管理员联系.
If you think this is a server error, please contact the webmaster.
错误403
本地主机 Apache/2.4.4(Win32)OpenSSL/0.9.8y PHP/5.4.16
localhost Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.16
我可以在localhost/Practice中看到我的.php文件列表(Practice是我保存文件的文件夹) 每当我单击该文件时,该文件就会打开. 但是,当我单击任何文件中的任何提交"按钮时,就会出现此错误. 请帮忙!我将xampp从1.8.1更新为1.8.2,但仍然存在相同的问题!
I can see the list of my .php files in localhost/Practice (Practice is the folder where I've saved my files) The file even opens whenever I click on it. But when I click on any 'submit' button inside any of my files, it gives this error. Please help! I updated xampp from 1.8.1 to 1.8.2 but still the same problem persists!
推荐答案
尝试下面的代码,将其添加到您的虚拟主机配置中.将此行添加到httpd-vhosts.conf
文件:
Try with this code below, add it in your virtual host config. Add this lines to httpd-vhosts.conf
file:
<Directory "c:/<path-to-projects>/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
我通过这种方式解决了相同的问题.希望对您有所帮助.
I fixed the same issue by this way. Hope it helps.
注意:
更改后请以隐身方式对其进行测试,因为您是通过缓存重定向的
after changes please test it in incognito because you redirected by cache
这篇关于Xampp禁止访问php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!