WordPress is an interesting platform to build your website but when you get this kind of errors, you feel like plucking your hair off your head because nothing is happening. I have tried like 10 solutions but never got it right until now.
Am sure you have gotten something like this when trying to update your plugin or upgrading WordPress.
This is the error for the Upgrading of WordPress
Downloading update from http://wordpress.org/wordpress-4.4.zip… Unpacking the update… Could not create directory. Installation Failed
This is the error for the plugin update
Downloading update from http://downloads.wordpress.org/plugin/your-plugin.0.9.3.1.zip… Unpacking the update… Could not create directory. /wp-content/upgrade/yourplugin.tmp Return to Plugins page
Plugin: Just change the permission of
/public_html/wp-content/plugins to 775. If the update succeed just revert it back to its default permission.
Upgrading: Just change the permission of
/public_html/wp-content/upgrade to 775. If the upgrade succeed just revert it back to its default permission.
chmod 775 /var/www/html/wordpress/wp-content/ chmod 775 /var/www/html/wordpress/wp-content/plugins chmod 775 /var/www/html/wordpress/wp-content/upgrade
Add the proper group permissions most likely to the same that Apache is running under.
ps aux | grep apache
You will see the Apache user group on the left.
See my example of how I did it:
Now change your WordPress folder to the same user group, you can do this in a parent folder or sub folder but for sanity it usually best for parent folder, use
-R to recursively do it.
chown -R apache:apache /path/to/wp-root-folder
- To login on windows use Putty
- Enter your hostname and port
- Choose connection type depending on server settings
- Click open
If you try to
chown and get denied you will need root privileges , type
sudo su and your password.
Now try updating the plugin or Upgrading WordPress.
Awesome!!! Now we have solved that issue.
Solution by Wyck