403执行PUT请求时 [英] 403 when performing PUT request
问题描述
我对apache配置非常陌生,正在尝试了解更多信息.发出PUT
请求时得到403 - Forbidden
,但是对相同URL的GET
可以正常工作.
I am very new to apache configurations and am trying to learn more. I am getting a 403 - Forbidden
when making a PUT
request, however a GET
to the same URL works fine.
是否需要启用某些内容以允许PUT
请求?
Is there something I need to enable to allow PUT
requests?
我正在使用Apache和PHP
I am using Apache and PHP
推荐答案
如果您使用的是Apache 2.4.x,则错误或丢失"Require"指令可能会导致403.
If you are working with Apache 2.4.x, a faulty or missing "Require" directive could the cause of the 403.
在virtualhost配置的<Directory>
块或.htaccess
文件中,添加以下行:
In the <Directory>
block of your virtualhost config, or your .htaccess
file add the following line:
Require all granted
有关"Require"语法的详细信息,请参见: https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require
For details on the "Require" syntax see: https://httpd.apache.org/docs/2.4/mod/mod_authz_core.html#require
这篇关于403执行PUT请求时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!