How do I enable PUT requests in Azure?

让人想犯罪 __ 提交于 2019-11-28 02:09:42

Add the following to the web.config in the system.webServer element:

<handlers>
  <remove name="PHP54_via_FastCGI" />
  <add name="PHP54_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v5.4\php-cgi.exe" resourceType="Either" requireAccess="Script" />
</handlers>

This works for the built in versions of PHP, the current default is PHP 5.4, but if you have selected PHP 5.3 or PHP 5.5 you will need to modify the path of the php-cgi handler.

JH Francois Yang

To complete the answer given by cory_flower you should change 54 by the version that is given,

Exemple: 7.2 gives:

<handlers>
  <remove name="PHP72_via_FastCGI" />
  <add name="PHP72_via_FastCGI" path="*.php" verb="GET, PUT, POST, HEAD, OPTIONS, TRACE, PROPFIND, PROPPATCH, MKCOL, COPY, MOVE, LOCK, UNLOCK" modules="FastCgiModule" scriptProcessor="D:\Program Files (x86)\PHP\v7.2\php-cgi.exe" resourceType="Either" requireAccess="Script" />
</handlers>

Pretty trivial but just for info

Update: fixed path

Add this to your web.config/system.webServer:

<handlers>
  <remove name="ExtensionlessUrl-Integrated-4.0" />
  <add name="ExtensionlessUrl-Integrated-4.0"
       path="*."
       verb="GET,HEAD,POST,DEBUG,DELETE,PUT"
       type="System.Web.Handlers.TransferRequestHandler"
       preCondition="integratedMode,runtimeVersionv4.0" />
</handlers>

or instead of specifying what verbs are allowed, say verb="*" to allow all the verbs.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!