Wordpress ftp credentials

Posted October 5, 2013 13.8k views
Good day, After the wordpress has been transferred ex another hosting I am required to fill in the FTP credentials each time I want to install plugin. I tried to add define('FS_METHOD', 'direct'); however no result. Although I can access ftp through one of the clients, it seems that ftp credentials received from Digital Ocean are not valid for my wordpress, because I keep receiving error in FTP username and/or passport. Please suggest possible reasons for that and any solution. Many thanks in advance.

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
7 answers
Your file permission is wrong. `define('FS_METHOD', 'direct');` is a forces method...

Change `wp-content` folder permission to 0777 and it should work. WordPress uses FTP as a backup to write new files.
Your folder permissions are wrong; but you should NEVER set them @ 777. The most liberal they should ever be is 755.

You can find the solution to your problem, in this thread: How do I enable Wordpress to update itself through its back end?.
I found the way. Now everything works. Thanks!
Hey Pablo,

I've read your other article discussion recursively changing permissions for www-data but I didn't see a final resolve or solution to the matter. Where you all able to figure out if it was necessary to run chown every time or if this was the most secure way to fix the issue? From your last response, it appeared that you didn't think it was a good idea to do this.
I had the same problem and it's solved thanks to this post

After you upload your files, you’ll want to make sure ownership permissions are set to Apache so that Wordrpess can update and/or install plugins without requiring FTP credentials. You can set permissions via SSH.

Single site hosting:

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

Multi site hosting:

chown -R apache:apache /var/www/

You may need to do this whenever uploading folders.