When you try to install or upgrade a plugin in WordPress, you will see this message
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.
If you enter your default root login and password, you will get this error message
Failed to connect to FTP Server mydomain.com:21
The error will always add :21 to whatever you type in the Hostname box.
The reason for this error is that a ftp server is not configured on your server.
To solve this problem, do the following steps:
(i) Install Vsftpd (Very Secure FTP Daemon) FTP Server
# yum install vsftpd
(ii) Turn On Vsftpd Service
# chkconfig vsftpd on
(iii) Start the service:
# service vsftpd start
# netstat -tulpn | grep :21
(iv) Create FTP user
# adduser -c 'FTP USER lion' -m lion
# passwd lion
(you will be prompted for a password. It will taunt you that your password is useless. You can ignore and retype your pw.)
(v) Restart the FTP:
# service vsftpd restart
(vi) Give Write Access to the wp-content and plugins folder with chmod 777
(vii) Now when you want to install or upgrade a wordpress plugin, you will be able to do so using the name and password set by you.
If you have multiple WP installations, you will get this error.
Unable to locate WordPress Content directory (wp-content).
To solve this problem, insert this code in the wp-config.php file:
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
I was suffering with this problem and the above page solved. Many thanks to you.
[…] We have seen that to be able to upload plugins to your wordpress, you need to install a ftp programme like vsftpd. […]
[…] This problem is solved by installing Vsftpd (Very Secure FTP Daemon) FTP Server. […]
[…] and changing the default port. You can also also install a CSF firewall. You can also install a vsftpd server to permit WordPress to download & install plugins. This entry was posted in Set Up VPS. […]
[…] means that ftp is installed on your server but there is an ownership […]
[…] vps2.me Copy-Paste Tutorials on how to set up VPS, set up VPS Domain, Secure & Harden VPS Server & Optimize VPS Skip to content Home ← WordPress VPS FTP Connection Problem […]