Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using 10.04 server I'm trying to upgrade Wordpress through the admin interface. I have a vsftpd server running and it is accepting local connections. For my FTP credentials I supplied the following:

  • Hostname: 127.0.0.1:21
  • Username and Password: The user supplied has write access to the /var/www directory structure.
  • Using plain ole FTP, not secure.

When I submit the upgrade, the following message is returned after a bit of time (1-2 minutes):

Downloading update from http://wordpress.org/wordpress-3.2.zip…

Unpacking the update…

Could not create directory.: /var/www/wordpress/wp-content/upgrade/wordpress-3.tmp

Installation Failed

I'm assuming this is a permissions issue, but I haven't been able to figure it out. Even setting the directories chmod 777 doesn't work. Any ideas? Thanks!

Edit: Testing with ftp 127.0.0.1 gives the following:

$ ftp 127.0.0.1
Connected to 127.0.0.1.
220 (vsFTPd 2.2.2)
Name (127.0.0.1:wpuser): 
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> mkdir /var/www/wordpress/wp-content/upgrade/test/
550 Permission denied.

Perhaps something is wrong with my vsftpd settings? Here is the vsftpd.conf file:

listen=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem

Edit Part 2:

I cannot submit an answer yet because I don't have enough reputation. This is how I fixed it though:

I finally fixed the issue, although it may not be the best solution. Keep in mind the FTP service is not accessible to the outside Internet.

So Wordpress tries to use FTP to create the directories and files needed for the upgrade. It does this when uploading plugins or themes as well. Because I also couldn't create a directory over FTP, I decided to try the following in the vsftpd config:

anon_upload_enable=YES
anon_mkdir_write_enable=YES

I restarted the server and everything worked. Now, I assume that this can be a security issue of some sort, but the anon account is disabled (anonymous_enable=NO).

Also, as an aside and a response to both the other suggestions about directory permissions, here is what I tried permissions-wise on the server.

  • All wordpress directories 775
  • All wordpress files 664
  • Owner: my user, Group: users
  • www-data user added to the users group (just a test, did not work obviously)

So I think www-data had write access to the necessary directories, but it still did not work. That's why I started exploring the FTP server issues.

I welcome any comments on this.

share|improve this question
    
I am not familiar with Wordpress, however, understanding that the upgrade is initiated in the admin interface, I suggest running the admin interface using sudo. –  Oxwivi Jul 11 '11 at 17:02

4 Answers 4

This document may help you understanding how permissions should be applied for your files/folders in order to Wordpress work without a hassle.

In my personal experience, giving 755 permissions to the WordPress folder does the trick, but certain folders will require to have 777 no matters what WordPress says, several plugins and/or updates (even to the WP core) won't work if those folders doesn't feature 777 permissions.

Quoted from the document that I mention in the top of this answer:

  1. All files should be owned by the actual user's account, not the user account used for the httpd process.
  2. Group ownership is irrelevant, unless there's specific group requirements for the web-server process permissions checking. This is not usually the case.
  3. All directories should be 755 or 750.
  4. All files should be 644 or 640. Exception: wp-config.php should be 600 to prevent other users on the server from reading it.
  5. No directories should ever be given 777, even upload directories. Since the php process is running as the owner of the files, it gets the owners permissions and can write to even a 755 directory.

This answer: General Rules for dealing with File Permissions will be helpful for a better comprehension on the permissions in a Ubuntu based system. Which -in case to be a local server- won't need to be accessed through a FTP Client in order to perform the task, but using a terminal.

If you need further information about this, feel free to drop a comment. My WP Blog can be reached via http://geppettvs.x10.mx/blog and I faced this issue lots of times in the past for remote and local servers.

Glossary for my answer:

  1. Local Server should be considered a computer that I can plug with a keyboard or mouse in order to interact directly with its OS.
  2. Remote Server is a computer that is not physically in front of me and I can't plug a keyboard or mouse to it in order to work with the computer's OS.
share|improve this answer
    
Thanks for your answer. I can't upvote yet (not enough reputation), but I will when I can. I tried to leave another answer describing how I solved the issue, but I can't for 8 hours. It basically boils down to two ftp configuration options. I'll edit my original post. –  Magicked Jul 11 '11 at 18:08
chown -R ftpuser.ftpuser /var/www/yourwebsite/wp-content/upgrade/

chmod 755 /var/www/yourwebsite/wp-content/upgrade/
share|improve this answer

Did you try changing the Owner and Group of the directory. Generally /var/www should have www-data as owner and group. Change owner & group of /var/www/wordpress... to the ftp user you are using. The command looks like the one below,

chown -R www-data:www-data /var/www/wordpress

And also try using ip address instead 127.0.0.1

share|improve this answer
    
Thanks for your answer. I can't upvote yet (not enough reputation), but I will when I can. I tried to leave another answer describing how I solved the issue, but I can't for 8 hours. It basically boils down to two ftp configuration options. I'll edit my original post. Also, I haven't tried this solution yet because I got it working with another method, but it might very well work. I will test later. –  Magicked Jul 11 '11 at 18:08

Have you looked at your available disk space? That was my problem when trying to update some plugins. I increased the quota and the issue was fixed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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