Wordpress asking for FTP Credentials

February 21, 2014 6.5k views
https://www.digitalocean.com/community/articles/how-to-install-wordpress-on-ubuntu-12-04, Okay, I used this for installing my wordpress. When I am trying to install a new theme, it is asking for FTP credentials, but I don't know what to insert.
7 Answers
Does running the following commands fix it?
sudo chown username:www-data /var/www -R 

sudo chmod g+w /var/www -R
WordPress usually asks for your FTP credentials when it can't access the files directly on the root of your webserver. This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files.

More info on the WordPress Forum:
Thank you Kamal! This works for me!
Kamal this is not working for me
  • After changing the permissions, try adding this to your wp-config.php to include this line:
    define('FS_METHOD', 'direct');

    That worked for me.

ryanginx that worked for me too. thx!!

Please, I run `sudo chown username:www-data /var/www -R
sudo chmod g+w /var/www -R
but don't work to me.```

How should I replace the commands??? Sorry, I'm beginner...

I insert

define('FS_METHOD', 'direct');

And too not works...

This is user's permission problem that will be solved by method given below that worked for me.

step-1 : First open wp-config.php file of your wordpress installation folder.
step-2: Copy below code and paste it at the end of the wp-config.php file.


step-3: Now open your droplet access console and enter root as username and its password.
step-4: Copy below code and paste it into access console where you have to specify your plugin directory path and then hit enter.

chmod 777 /yourwebsitename/public/wp-content/plugins/

Note: Replace your website name in the place of yourwebsitename.
Thank you.

Have another answer? Share your knowledge.