why i can't install a new plugin on my wordpress?

Posted December 30, 2014 135.9k views

I can connect my vps ip with putty ,hostname is a.b.c.d , ftp user is root ,password is password .
None of connection type (ftp or ftps) can add a new plugin .

Failed to connect to FTP Server

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.


These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
19 answers

Wordpress will prompt you for FTP credentials if it does not have permission to write the files it needs to. If you log in via putty and run the following command (assuming this is an Ubuntu droplet) it will set the files to be owned by the user that the web service is run as and should resolve the problem.

chown -Rf www-data.www-data /var/www/html/

On Centos running Apache to serve you can do like above but for the apache user

sudo chown -R apache:apache /var/www/html

hope this helps someone

The command solved my problem.
What does www-data.www-data mean?
www-data is the group name ,how about the second www-data ?

root@rebuild:~# cat /etc/group

  • This is the user and group. In this case they share the same name. The syntax works like:

    chown -Rf /path/to/files

    Where -Rf tells chown to implement this change ® recursively and to (f) force the change rather than prompt for each file.

    The can also be indicated with a colon separating them as user:group (some systems may not accept the . instead of the : )

If you use the Centos system and use the NGINX as webserver, please type in terminal is:

sudo chown -R nginx:nginx /var/www/

This command will allow nginx execute read/write to folder /var/www/

Hey friend,
You can check out for the solution.

At current date, there is no lack of WordPress plugins but the main problems arise during their installation. Especially while doing it via FTP method. Well it’s not like unsolvable issue; you can just follow the link I have suggested in order to tackle it down.

Thanks man, u wouldnt be able to guess the time i spent dealing with this, not to mention ruining my website in the process.
thanks thanks thanks X10000000000

It’s awsome! I was trying to do this for two days! hahaha

Awesome!! Thank you for sharing the wonderful comment. I was able to resolve that issue as well.

Previous 1 2 Next