Unable to update plugin for WordPress installation: Could not create directory

Created:

2016-11-16 13:25:07 UTC

Modified:

2017-08-08 13:14:29 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to update plugin for WordPress installation: Could not create directory

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk Onyx for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Symptoms

Following error is shown when trying to update Wordpress version or plugins from Plesk > Websites & Domains > example.com > WordPress page:

Update Plugin
Downloading update from https://downloads.wordpress.org/plugin/plugin_name.zip…
Unpacking the update…
Could not create directory.

or the following one:

Updating Plugin
Downloading update from https://downloads.wordpress.org/plugin/plugin_name.zip…
Unpacking the update…
Installing the latest version…
Removing the old version of the plugin…
Plugin upgrade failed.
An error occurred while updating Contact-Form: Could not remove the old plugin..

Cause

Incorrect permissions set in domains folder.

Resolution

For Windows:

Restore permissions with the following commands:

"%plesk_bin%\\reconfigurator.exe" /check-permissions=example.com  
"%plesk_cli%\\repair.exe" --repair-webspace-security -webspace-name example.com

For Linux:

The WordPress toolkit is designed to work using SuExec. When apache module or FPM is used, the directories may be set to www-data user permissions. It is required to set correct permissions for wp-* system folders like sys_user.psacln to use WordPress Toolkit.

In order to do this, firstly determine a name of system user either in properties of subscription in Plesk, or using a command

# plesk bin subscription -i example.com | grep "FTP Login" 
FTP Login: user3045

Then find WWW root for this domain:

# plesk bin subscription -i example.com | grep "WWW-Root"
--WWW-Root--: /var/www/vhosts/example.com/httpdocs

and set correct file permissions on this directory:

chown -R user3045:psacln /var/www/vhosts/example.com/httpdocs/*
Have more questions? Submit a request
Please sign in to leave a comment.