How to Solve WordPress Could Not Create Directory

Standard

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

SOLUTION:
Step 1:

Plugin: Just change the permission of /public_html/wp-content and /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 and /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

Step 2:

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:

Screen Shot 2015-12-15 at 11.37.13 AM

Step 3:

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

 

If it helped you out, please don’t forget to like and share 🙂

Advertisements

9 thoughts on “How to Solve WordPress Could Not Create Directory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s