venerdì 5 luglio 2013

WordPress Solution: Failed to connect to FTP Server localhost:21

During a recent installation of WordPress 3.3 on my local Linux (Ubuntu) box, I attempted to change the theme and was met with an error I was unfamiliar with. The installation fails and gives the error:

Failed to connect to FTP Server localhost:21


It then asks you to enter your FTP hostname, username, and password. Various resources on the web suggested I use my Ubuntu login while others said my WordPress admin account information. Neither of these worked.

As it turns out, WordPress 3.3 (and apparently earlier versions as well) installed on Ubuntu Linux require the owner:group of the wordpress directory to be www-data:www-data.

How To Fix It

  1. Open a terminal and traverse to your WordPress directory on your localhost. For me the command is: cd /home/cillosis/mysites/wordpress 
  2. Run this command: sudo chown -R www-data:www-data * 
  3. You should now be able to install themes and plugins. Enjoy!