When installing plugin(s), WordPress sometimes requests FTP credentials. It happens because WordPress cannot access the files and write to the /wp-content directory. This is generally due to changed permissions on WordPress directories.
You can choose to enter FTP credentials, but we still recommend updating WordPress differently. You can adjust the permission to the /wp-content folder by resetting the permissions to 775 instead of the standard 755 and 644.
To fix this issue, you need to define a simple rule inside the wp-config.php file so that you don’t have to enter them every time you install/update a plugin.Â
This KB will explain the steps to fix the FTP Credentials issue using SSH and SFTP.
1) Fix FTP Credentials issue via SSH
To connect your web application via SSH using Master User or Application User, visit How to connect your application via SSH and SFTP.
- Navigate to the application webroot, i.e., public_html folder where your wp-config.php file is located.
- Edit the wp-config.php file using any text editor, whichever you want to use.
Enter the below command just before this line define(‘DB_NAME’, ‘*****’);
define('FS_METHOD','direct');
- Save the file and quit.
Now you can easily update/install the plugin in WordPress.
2) Fix FTP Credentials issue via SFTP
- Download the FileZilla and install.
- Connect FileZilla using Master User or Application User.
- Go to the application webroot folder, i.e., public_html, where your wp-config.php file is located.
- Download the wp-config.php file to your local system.
- Edit the wp-config.php using notepad
- Enter the below command just before this line define(‘DB_NAME’, ‘*****’);
define('FS_METHOD','direct');
- Save the file and re-upload to the exact location, and overwrite the existing wp-config.php
Now you can easily update/install the plugin in WordPress.