You should add the following code with your FTP details in wp-config.php
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.org:21' );
Other thing you can do is give full permissions to the current user so that wordpress can automatically create folders and files in wp-content/plugins
Run these two commands with www-data replaced with your username and
wordpress replaced by the path to your wordpress installation.
chirag$ cd /var/www
chirag$ sudo chown -R www-data:www-data wordpress
Gave it 0755 permission to the wp-content and all it’s subdirectories I still get the same error “write to” message.
The thing you suggested adding to the file I already tried.
Have you checked who is the owner of the directory and which user is trying to upload the plugin files into wp-content/plugins directory. Are they same ?
How do I do that in CentOS? I think there is only the Root user as I have not made any other users.
Please try adding
define('FS_METHOD', 'direct');
this to your wp-config file ?
That allowed the FTP host to work now 🙂
However there is still an issue with allowing it to right.
http://i.imgur.com/9eSZ9pG.png
Also here is a screenshot that only the root is using it: http://i.imgur.com/jQ9tY3o.png
Fixed:
To anyone else having this problem add this to the end of your wp-config.php file:
define( ‘FTP_USER’, ‘username’ );
define( ‘FTP_PASS’, ‘password’ );
define( ‘FTP_HOST’, ‘ftp.example.org:21’ );
define(‘FS_METHOD’, ‘direct’);
(fill in the FTP details with yours)
then chmod 755 to the wp-content directory using this command:
chmod -R 777 /dir1/dir2/dir3/wordpress/wp-content/