如何使用Slim在Apache2和PHP7上启用PUT和DELETE

时间:2017-06-25 12:20:02

标签: php apache http

我一直在努力从我的API服务器启用PUTDELETE请求。我检查了/etc/apache2/mods-available/userdir.conf文件,它看起来如下:

<IfModule mod_userdir.c>
        UserDir public_html
        UserDir disabled root

        <Directory /home/*/public_html>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Require all granted
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Require all denied
                </LimitExcept>
        </Directory>
</IfModule>

我在PUTDELETE块中的OPTIONS之后添加了limitlimitExcept,然后重新启动了apache服务器。尽管如此,我的PUT / DELETE来电仍然向我发出以下错误:

Method not allowed
Method not allowed. Must be one of: GET, POST

非常感谢任何帮助。谢谢!

0 个答案:

没有答案