WP upgrade can’t create directory even though perms are 777

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.

Read More

Any idea why this happening?

Related posts

Leave a Reply

13 comments

  1. 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. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.