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 trialRoss Horak
20,890 PointsI 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)
- Why am I being asked for FTP connection information?
- Where can I find my local FTP connection infromation?
- Most importantly, what is the solution to not be asked for connection information?
5 Answers
Jose Platas
19,745 PointsAnother 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.
Adebayo Quadri
10,704 PointsThanks. Your reply was really helpful.
Ross Horak
20,890 PointsHi 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
13,859 PointsI 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.
fabrciojardimferreira
8,100 PointsI'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
20,890 PointsMake 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?
fabrciojardimferreira
8,100 Points@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
Treehouse Guest TeacherDid that suggestion from John answer your question?
This likely has to do with either firewall or security settings on your computer.
John Hartney
2,893 PointsJohn Hartney
2,893 PointsHey 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)