Upgrading /Installing WordPress Plugins will Ask For FTP Details .

WordPress is a free and open-source content management system (CMS) written in PHP and paired with a MySQL or MariaDB database. WordPress is the simplest, most popular way to create your own website or blog.  WordPress is used by more than 60 million websites, including 33.6% of the top 10 million websites as of April 2019.

Sometimes to perform the  upgrading /installing WordPress Plugins, 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.
I’ve seen this error a few times and believe I know the easiest fix when you run into this on unix hosting.

Everytime I’ve seen: “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.”

… it was a permissions issue.

If you’re on a ‘nix box make sure you chown the files to be that of apache or whatever your httpd user is.

cd /var/www/html/wordpress_website.com/
chown -R apache:apache *

This way when wordpress commands apache to download and install files, your OS will allow it to do so without the use of FTP.

And dont even bother configuring FTP for this purpose, its a pain.

=====

So just in case you have this issue you can add your FTP account in your wp-config.php. Here how to do it:
1. Download your wp-config.php, open it in your favorite text editor.
2. Insert these lines somewhere in your wp-config.php, but i prefer put it under database code:

====================================
/*** FTP login settings ***/
define(“FTP_HOST”, “localhost”);
define(“FTP_USER”, “ftp-user”);
define(“FTP_PASS”, “ftp-password”);
====================================
Note: don’t forget to change “ftp-user” and “ftp-password” to your ftp account credential
3. Save and upload your wp-config.php file again.
4. Test it, and it should be fine now.