6

I'm trying to upgrade to WP 3 but I'm getting a weird error when I try to do so:

Downloading update from http://wordpress.org/wordpress-3.0.4.zip.

Unpacking the update.

Could not create directory: /my/path/web/wp-content/upgrade/wordpress-3.tmp

Installation Failed

The reason it's weird is because the upgrade directory has 777 permissions. I ran chmod -R 777 upgrade/ and when I do an ls, I see that upgrade is world-writable. I'm sure I'm dealing with the right directory because if I delete upgrade, I get a different error.

Any idea why this happening?

2
  • is php safe_mode activated? – Cronco Jan 27 '11 at 4:16
  • and is the owner of that directory correct? The right permissions needed vary across different server implementations – Tom J Nowell Jan 27 '18 at 1:49

13 Answers 13

7

You need to run the chown command on whole wp-content directory:

chown www-data:www-data /path/to/wp-content/ -R
2
  • This worked for me. – Zabba Jul 12 '11 at 6:26
  • depending on server, user/group might be nobody instead of www-data – yitwail Feb 25 '13 at 23:39
6

Cannot creating directories even through a 777 CHMOD imply that your FTP local users does basicaly not have the permission to write files on your machine, to fix that try to edit your vsftpd.conf file and check that write_enable is equal to YES

Edit vsftp.conf file

sudo vim /etc/vsftpd.conf

then uncomment the existing line (or set it's value to YES)

write_enable=YES
2
  • 1
    Please explain why this edit will help the Question. A code-only answer is a worst one. – Mayeenul Islam Jul 16 '14 at 4:08
  • 2
    @MayeenulIslam , answer edited – Mohamed Ayoub BENJELLOUN Jul 17 '14 at 23:39
5

The fix turned out to be to change vsftp's permissions in the vsftp config file.

5
  • Then mark your answer as The Answer. – fuxia Jan 20 '12 at 17:44
  • 2
    There's a delay before they let you do that, buddy. – Jason Swett Jan 20 '12 at 18:46
  • 5
    Could you be more specific about the changes to vsftpd.conf? – iyrin Jan 7 '14 at 20:07
  • @JasonSwett, bad answer, please go into detail what exactly did you changed? – Black Jul 9 '18 at 9:10
  • Sorry, this was years ago and I don't remember the details. – Jason Swett Jul 9 '18 at 13:32
4

turned out to be a disk space error for me. I deleted a few backup files and I no longer had a permissions issue.

2

What account is the directory owned by? Try CHOWNing the directory to the account your web server runs as (probably "apache").

This generally looks like:

chown apache:apache your/path/to/upgrade

But YYMV depending on your server setup.

For some reason (I'm not a skilled server admin), ownership of the directory can cause permissions issues, even if your permissions are set to 777.

2
  • It's owned by user jason. I already tried chowning my dir to www-data (my Apache user) but it still didn't work. – Jason Swett Jan 26 '11 at 22:09
  • @Jason Swett Hmm... did you also change the group when chowning? The upgrader (eventually) just uses mkdir to create the directory, so you could test any changes you make to permissions/groups by making a simple script that runs a mkdir command, and hit it with your browser until it works. – MathSmath Jan 26 '11 at 22:31
1

This might be an issue with php's safe_mode. It has made my life hell when dealing with uploads in automatically generated folders, and I suspect this may be the case here.

If it is activated, please enter your cpanel, plesk panel, contact your sys admin, try to deactivate it and try again.

1
  • Thank you. After wasting a lot of time I found your comment. In plesk panel for a domain there was a setting to deactivate safe_mode (It could also be done via php.ini). – tavi May 5 '14 at 9:00
1

While trying to upgrade WordPress, I was getting the error “Could not create directory”. I searched for solutions and found several other recommendations I’ll share with you, and then what finally worked for me.

The first is to go to wp-content -> upgrades folder, remove it, and then recreate it and chmod 777 (you may also want to chmod 777 the entire /wp-content folder). After installation is done chmod back to 755.

The second is to disable all plugins, or at least all the security plugins.

The third is to do a manual installation.

Since this was the first time I’d gotten a failure-to-upgrade error, I decided to try disabling just my most recently-installed security plugin which is called AskApache (I didn’t change any permissions). The upgrade then went through without any problems.

1

I had this same problem, unable to update plugins or update themes. I also was unable to upload photos but I was able to create a new post. My problem turned out to be a disk space issue it would appear because after deleting some backup files I was able to get everything to work. I am using free hosting and my cpanel said that I was not close to being out of storage space so I originally did not consider this for a solution.

1

Check your filesystem quotas, this was my issue, once I updated the quotas to a larger size then Wordpress worked fine.

0

Who is your webhost? Ownership of new directories can be problem with some (cheap) host(s) and you won't be able to change it without their help.

And don't leave any directories at 777. WP needs a maximum of 755.

0

I had the same problem, and found out / fixed it:

  1. The user who cannot create the directory is the ftp user you use for upload. In an save environment you can enable root user to log in via ftp. But - be sure to disable the root user for ftp afterwards. Do not forget it.

  2. In my installation (ubuntu 16.04) I had two wp-content/plugins directories - don't ask me why. usr/share/wordpress/wp-content/plugins and var/lib/wordpress/wp-content/plugins . Make sure both directories are writeable by the ftp user.

0

I solved this by downloading and moving the unzipped plugin folder to the wp-content/plugins and then changed its permission to 777. This way, I was able to see the plugin in the WordPress admin plugins screen.

0

You should redownload wordpress files, it is possible that you have missing folders-files. Same thing happened to me before, 10 mins ago..

1
  • 1
    The error states that the directory could not be created. It doesn't matter whether it existed before. – fuxia Jan 8 '17 at 9:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.