Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Local WordPress Development Local WordPress Development Migrating WordPress from Local to Live Server

Ross Horak
Ross Horak
20,890 Points

I cannot install plugins or themes from a local WordPress installation. (Ubuntu/XAMPP) Connection Information required

I have created a local WordPress installation with everything working fine. When I try to install plugins or themes from the local WP install, I get a wordpress screen in the backend stating the following:

Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Hostname
FTP Username
FTP Password

This password will not be stored on the server. Connection Type Connection Type FTP FTPS (SSL)

  1. Why am I being asked for FTP connection information?
  2. Where can I find my local FTP connection infromation?
  3. Most importantly, what is the solution to not be asked for connection information?
John Hartney
John Hartney
2,893 Points

Hey Ross, Try

FTP Username - admin or root

FTP Password - leave this blank

Where can I find my local FTP connection infromation? See /xamp control panel/filezilla Admin/click-OK/edit. Here you will find settings to configure users and groups however, I don't suggest you alter anything unless you plan to set up apache to access your files from the www

Most importantly, what is the solution to not be asked for connection information? Your FTP credentials can go directly in wp-config.php

(``` define( 'FTP_USER', 'username' ); define( 'FTP_PASS', 'password' ); define( 'FTP_HOST', 'ftp.example.org:21' );

[Reference](http://codex.wordpress.org/Editing_wp-config.php#WordPress_Upgrade_Constants)

5 Answers

Jose Platas
Jose Platas
19,745 Points

Another way to make sure that you can install wordpress themes and plugins without any problems is adding the following line to the wp-config.php file. https://codex.wordpress.org/Editing_wp-config.php

define('FS_METHOD', 'direct');

"direct" forces it to use Direct File I/O requests from within PHP, but this could create security issues so i suggest to comment/delete this line once you put your files in a life host.

Also you may run into another problem once you try to install themes. It will show you no problems when you download the theme but it will not create the folder inside your project. The reason why is because of permission settings in your development site folder.

http://www.mactricksandtips.com/2008/03/automatically-set-subfolders.html In order to change the folder permission you have to do this.

right click on the root folder of your site> click 'Get Info' > click on the lock in the bottom right part of new window open> put your admin password>change permission settings for your folder> click on the gear icon and click on 'apply to enclosed items..."

This will change the permission settings in all of the folders inside your local site and allow folders/files to be created by plug ins or themes.

Thanks. Your reply was really helpful.

Ross Horak
Ross Horak
20,890 Points

Hi John and Zac,

Thanks for your answers and follow ups.

John, thanks for the FTP workaround, much appreciated. From what I understand however, WP only asks for FTP details when it cannot access your files directly. FTP is not optimal as it is not as fast as direct WP access - Zac please correct me if I'm wrong?

The reason WP was asking for FTP details was a permissions issue to my root folder where my sites are kept on my local install. To solve this I ran the following recursive command (I'm using XAMPP on Linux Ubuntu): sudo chmod -R 777 /opt/lampp/htdocs/sites

Daniel Schroeder
Daniel Schroeder
13,859 Points

I did a local install of WordPress on Ubuntu 16.04 following the steps outlined here and simply running:

sudo chown -R www-data:www-data /usr/share/wordpress

solved my issue with downloading plugins. The only reason I'm leaving this post here is because when I googled my issue, this was one of the first results and Ross' post led me to the solution to my problem.

I'm running into the same problem here with Linux Mint and Xampp.

I tried to follow John's solution but I'm not sure, what should I type in hostname. I tried both localhost and localcost/localwp.com/wordpress (localwp.com/wordpress is my path). No success.

Tried to follow Ross steps:

sudo chmod -R 777 /opt/lampp/htdocs/localwp.com/wordpress. No success.

Tried to follow Daniel:

sudo chown -R www-data:www-data /opt/lampp/htdocs/localwp.com.wordpress* (my path) No success.

By no success I mean, the site keeps asking my ftp credentials. On Xampp control panel I can't find any option about ftp config. I found that the config file is /opt/lampp/etc/proftpd.conf but I don't know what should I look into.

I sure must be overlooking something. Any tips?

Edit: I managed to install the theme I wanted by extracting it in the proper folder, but still looking for a more definitive solution. I'm also put permissions and ownership back to default the best I could (permissions 755 for directories and 644 for files, ownership nobody:nogroup except for wp-config which is owned by root:root)

Edit 2: Solution:: Xampp comes with Proftpd as ftp server which is configured by this config file /opt/lampp/etc/proftpd.conf. Reading the file I realized that it considers the server is running under ownership of "daemon:daemon". My wordpress directory is running under nobody:nogroup so I changed this line into proftpd.conf :

# Set the user and group that the server normally runs at.

User nobody

Group nogroup

The config file also defaults "xamp" as password for the daemon user, so I just changed the user in this line for nobody:

# daemon gets the password "xampp"

UserPassword nobody 2TgxE8g184G9c

This is it! Everything seems to work just fine using hostname "localhost" username "nobody" and password "xammp".

The only doubt remaining is: this is safe? Am I somehow exposed by doing this?

Thanks for any help!

Ross Horak
Ross Horak
20,890 Points

Make sure you are applying the permissions to the correct directories..

Your directory structure may be different to my example.

Or perhaps try applying it to the parent directory.. e.g. sudo chmod -R 777 /opt/lampp/htdocs *if that is your directory structure..

You can then also check that permissions where changed by viewing directory list and details with the following command: ls -l

Let me know if that doesn't work?

@Ross Horak: Thanks for your fast reply. I think I found the problem and updated my post with the solution. If you have any new insight on the security it will be appreciated.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Did that suggestion from John answer your question?

This likely has to do with either firewall or security settings on your computer.