Reference

WordPress Could Not Create Directory, Plugin Upgrade Failed On IIS

Upgrading plug-ins in Wordpress 5.2.x or 5.3.x may fail on IIS 7 due to a bug in the Windows Cache Extension for PHP.

Tags: iis infrastructure php wordpress

Overview

When running WordPress with PHP 5.2.x or 5.3.x on IIS 7 with the Windows Cache Extension for PHP installed and enabled, the following error message may appear when attempting an upgrade of WordPress plugin-ins through the dashboard:

Unpacking the update.
Installing the latest version.
Deactivating the plugin.
Removing the old version of the plugin.
Could not create directory. DIRECTORY\wwwroot/wp-content/plugins/[pluginname]/
Plugin upgrade Failed.

This is due to a bug in current versions of WinCache Extension for PHP.

Solution

There is no solution at the time of this writing. The workaround is to disable the WinCache Extension for PHP prior to upgrading WordPress plug-ins. This can be achieved by commenting out or removing the following line in the [PHP_WINCACHE] section of the server’s php.ini and restarting the World Wide Web Publishing Service in the Windows Services Manager:

extension=php_wincache.dll

After successfully upgrading the plug-ins, the extension can be turned back on by un-commenting or adding the line above.

Related Resources

The problem has been discussed on various online forums, most notably on the WordPress Support Forums and the IIS.net forums.

In late September the WinCache development team offered version 1.2.924.0 as a potential fix, which did not work. A newer version with a definitive fix has been announced to exist, but the original developers have since been replaced with new programmers, so don’t hold your breath for an early release.

The latest development versions of WinCache can be downloaded on the project’s download page.