Xampp访问禁止php

2022-01-14 00:00:00 xampp 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

相关文章