Connection Information : To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

While we are using WordPress, It will be easy to add some advanced feature in existing site through plugins, We can install plugin’s through WordPress admin panel in just 1 click. But sometimes, While we are click on install button of any plugin, It shows us 1 popup with message “Connection Information : To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

This popup display because of your file and folder have some invalid permissions. So, Here we will see how to fix this FTP details of your server error on plugin install time.

There are 2 ways to fix “To perform the requested action WordPress needs to access your web server. please enter your ftp” Error.

  • By add code in wp-config.php file
  • By change entire site permission

Solution 1: By add code in wp-config.php file

Add the following code in your site’s wp-config.php file:

define( 'FS_METHOD', 'direct' );

The constant FS_METHOD forces the filesystem method.

We can use directssh2ftpext, or ftpsockets.

Basically, We should only change this if we have any issues with FTP.

Also, Prefer the below sequence while experimenting with the constant FS_METHOD.

  • direct forces it to use Direct File I/O requests from within PHP, this is fraught with opening up security issues on poorly configured hosts, This is chosen automatically when appropriate.
  • ssh2 is to force the usage of the SSH PHP Extension if installed
  • ftpext is to force the usage of the FTP PHP Extension for FTP Access, and finally
  • ftpsockets utilizes the PHP Sockets Class for FTP Access.

Solution 2: By change entire site permission

If above solution will not work, This means that WordPress is having limited permission for making changes in the folder that it was installed.

In-order to fix this, all that you need to do is provide necessary permissions for the same.

Run the following Command in your Terminal / Putty / Command-line Prompt after connecting to your Server via SSH:

sudo chown -R www-data:www-data /var/www/html

OR


sudo chown -R www-data:www-data /var/www/Your-Site-folder-name

chown command will change site user as apache user which is www-data instead of your server default user like ubuntu OR root.

Above command will give permission to all files and folders inside your site main directory.


Hope, Above 2 solutions will works for you. You can check this solution at WordPress official site also here.