patrickfitzg's picture

I am having trouble with FTP on Wordpress with Turnkey: I cannot update Wordpress or install new themes. It seems to boil down to FTP. I just cannot get it working.

I have read:

http://www.chrisabernethy.com/why-wordpress-asks-connection-info/

This is partially helpful, in that it is telling me the nature of the problem, but nothing I try on this page seems to work. As well, there is lots of conflicting advice in the comments. One can never tell whether wrong step has ruined right step's ability to work.

Steps to reproduce:

1. Log into WordPress

2. Navigate to Appearance>>Install Themes

3. Open a Theme demo

4. Click on Install

5. Get FTP page and try many variations on the Ip address with protocols and ports. (see image)

I do think that I have not sorted out the permissions issue highlighted in the article above. I am lost.

Can you help?

Forum: 
Jeremy Davis's picture

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

Theregied's picture

This post is really very helpful for me. Thanks for sharing it. You have solved my problem.
 

patrickfitzg's picture

Jeremy, thanks. I had already tried that and it did not work.

I typed and ran the command. There was no feedback at the prompt, which I am led to believe is the *nix way of saying "done".

Tried the update later and I got 

---

 

Downloading update from http://wordpress.org/wordpress-3.5.1-new-bundled.zip

Unpacking the update…

Could not copy files.

Installation Failed

---

I tried the FTP connection through FileZilla Client and I got:

Connection attempt failed with "EAI_NODATA - No address associated with nodename".

 

any suggestions? I am sure I am missing something fundamental that a non-noob knows instinctively.

 

P

Jeremy Davis's picture

Sorry that didn't work, I was pretty sure it would... :(

I don't use WordPress, but from my reading I'm sure that it's a permission issue (like noted in the article). Perhaps the directory that the installs need to go in is read only (even when owned by www-data)?

AFAIK the FTP request is aimed at WordPress users on shared hosting, not on dedicated servers (like TKL is). TKL does not have a stadard FTP server installed (only SFTP via OpenSSH - and as www-data is not allowed to login as a normal user SFTP won't work).

Acording to the article you link to WP only needs write access to the wp-content/plugins folder (which I assume is probably at /var/www/wordpress/wp-content/plugins) so try

chmod -R 655 /var/www/wordpress/wp-content/plugins

and check ownership and permissions

cd /var/www/wordpress/wp-content/plugins
ls -la

If that doesn't work, then I'm not sure sorry...

IronOak IT's picture

http://wordpress.2bearstudio.com/wordpress-update-installation-failed-co...

 

simple fix, but specific to TKL implementation:

in your /var/www/wordpress

chown -R www-data:www-data *

 

This made all the plugin, themes and upgrade folders consistent with the owner:group that runs the rest of wordpress out of the box.

 

I also had to make the FS_Method,direct update in wp-config.php

Brent Quick's picture

I did the "chown" part but not the "I also had to make the FS_Method,direct update in wp-config.php" part and it is now working.

 

Used turnkey-wordpress-13.0-wheezy-amd64.iso

David Taylor's picture

Here is the solution we are using to resolve the WordPress update issue. The plugin adds SFTP support to WordPress.

http://wordpress.org/plugins/ssh-sftp-updater-support/

Jeremy Davis's picture

There is also a workaround that means you don't need to use the plugin. From Issue #173:

1. Give the webserver ownership of the /var/www/wordpress/wp-content/ folder tree.

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

2. Add an entry to the wp-config.php file. Open it for editing:

nano /var/www/wordpress/wp-config.php

And add this:

define('FS_METHOD', 'direct');

Make sure it goes ABOVE this line:

/* That's all, stop editing! Happy blogging. */

3. Restart Apache:

service apache2 restart
Paul Z's picture

This was the fix we stumbled upon too. It doesn't require changing configuration files or opening up FTP on the server. I found this thread because I wanted to recommend this plugin be added as a feature request to the future TK Wordpress appliance to make it easier for other users. SSH (SFTP) is enabled by default, so it just works.

Jeremy Davis's picture

Thanks for posting.

Pedro Braconnot's picture

If you are using a linux user to do ftp you can do this

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

You'll need to make sure proftpd restricts users to their home folders. Wordpress will fail without that.

In a cPanel environemnt this is default but if you are in a Ubuntu server for instance do this:

vi /etc/proftpd/proftpd.conf

then uncomment the line that starts with #DefaultRoot

# Use this to jail all users in their homes
DefaultRoot                     ~
Jon's picture

I followed the above solution that David Taylor posted and was then able to update my plugins and themes through the Wordpress GUI. However when I go to update wordpress itself via the GUI I get the following.

 

Downloading update from http://downloads.wordpress.org/release/wordpress-4.3-new-bundled.zip…

Unpacking the update…

Could not copy files.

Installation Failed

Jeremy Davis's picture

My guess is that it is a permissions issue. Either the files downloaded belong to root (so www-data can't unpack them) or perhaps it's because root owns most of the WP files so www-data can't overwrite what it needs to...

Add new comment