5

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?

Ahmad Maleki
  • 1,415
  • 3
  • 21
  • 35
Asheesh
  • 161
  • 3
  • 16
  • 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 May 04 '16 at 06:19
  • give permission to the user for that directory, and also check directory permision – JiteshNK May 04 '16 at 06:19

3 Answers3

8

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?

Ahmad Maleki
  • 1,415
  • 3
  • 21
  • 35
Tharif
  • 13,794
  • 9
  • 55
  • 77
7

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

Milap
  • 6,915
  • 8
  • 26
  • 46
Mukesh Ram
  • 6,248
  • 4
  • 19
  • 37
3

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/

Milap
  • 6,915
  • 8
  • 26
  • 46
  • 1
    @AnshuPratapYadav, Great , consider to accept my answer and upvote. :) – Milap May 04 '16 at 06:23
  • 2
    @Anshu Pratap Yadav Please see the concerns related to `define('FS_METHOD', 'direct');` http://wordpress.stackexchange.com/questions/189554/what-security-concerns-should-i-have-when-setting-fs-method-to-direct-in-wp-co – JiteshNK May 04 '16 at 06:24