5
votes

I'm getting prompted for FTP credentials (ftp username, ftp password, host address) everytime I'm trying to install a plugin or theme in my WordPress Website.

How can I prevent it?

3
Check the group and user permissions and owner. On CentOS the group and user should be apache, while on Ubuntu server the user and group should be www-data. - dingo_d
give permission to the user for that directory, and also check directory permision - JiteshNK

3 Answers

7
votes

Since the files are not getting access you are prompted with FTP credentials.

There are 2 options to follow :

  1. Provide the FTP credentials inside /wp-config.php file :

define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp.example.com:21' );

  1. By Pass the check as show in the SO post :

Can I install/update WordPress plugins without providing FTP access?

7
votes

Follow the below steps.

  1. Open wp-config.php

  2. Edit the file.

  3. Add the following given line after WP_DEBUG

    define('FS_METHOD', 'direct');

  4. Save

3
votes

The easiest way to solve this problem is add the following code in your wp-config.php

define('FS_METHOD', 'direct');

If still problem exists, follow the steps given by following link :

https://www.narga.net/stop-fix-wordpress-ask-for-ftp-credentials-upgrade-install-delete-themes-plugins/