405 method not allowed – IIS and Gutenberg

Web.config 405 method not allowed iis

Some servers are not configured to allow all of the functionality for Gutenberg, the new WordPress editor. When saving, the PUT operation might be disallowed, giving you an error like: “405 method not allowed”. If you have access to your web.config file you can fix this problem with a minor change.

Change:

<add name="php-7.0.11" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files\PHP Manager 1.2 for IIS 7\PHP-Versions\php-7.0.11-nts-Win32-VC14-x86\php-cgi.exe" resourceType="Either" requireAccess="Script" />

To:

<add name="php-7.0.11" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\Program Files\PHP Manager 1.2 for IIS 7\PHP-Versions\php-7.0.11-nts-Win32-VC14-x86\php-cgi.exe" resourceType="Either" requireAccess="Script" />

Or, just add the “PUT”:

<add name="php-7.0.11" path="*.php" verb="GET,HEAD,POST,PUT,OPTIONS" modules="FastCgiModule" scriptProcessor="C:\Program Files\PHP Manager 1.2 for IIS 7\PHP-Versions\php-7.0.11-nts-Win32-VC14-x86\php-cgi.exe" resourceType="Either" requireAccess="Script" />

For more information about IIS and the “405 method not allowed error”, you can check out the official website at https://www.iis.net/

Edit: Updated January 27, 2019 to reflect that sometimes “OPTIONS” is required as well.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.