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