WordPress | Installing plugin updates requesting FTP login details

Recently I migrated a large number of WordPress sites from cPanel to Cloud Panel. Once I got all the sites operational, I decided to go and install pending plugin updates on a number of them.

Upon updating, WordPress requested FTP details – something I hadn’t come across before as it should be able to install them without requiring FTP access.

I checked file & directory permissions – correct!

In the end, a few posts online led me to two things to add to the wp-config.php file to address this issue:

Edit the wp-config.php and find a good place to add three lines of code – maybe where the rest of the define statements are located.

First line is to force WordPress to update directly instead of deciding on the fly how to access the file system:

define('FS_METHOD', 'direct');

Next two lines force permissions on files & directories when working on them:

define('FS_CHMOD_DIR',0755);
define('FS_CHMOD_FILE',0644);

Save the changes to the wp-config.php file, then refresh the updates page. Now you should be able to install the updates directly in the web without requiring FTP access.