Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Ross Horak20,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:
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.
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?
Jose Platas19,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
"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.
Ross Horak20,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
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.
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: 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 GordonTreehouse Guest Teacher
Did that suggestion from John answer your question?
This likely has to do with either firewall or security settings on your computer.