WordPress asking for FTP credentials on localhost

To resolve the issue of WordPress asking for FTP credentials on localhost, follow these steps:

  1. Open the wp-config.php file located in the root directory of your WordPress installation.

  2. Look for the line that says define('FS_METHOD', 'ftpext'); or define('FS_METHOD', 'ftpsockets');. If you can't find either of these lines, just add the following line: define('FS_METHOD', 'direct');.

  3. Save the wp-config.php file and try accessing your WordPress site again.

By editing the wp-config.php file and changing the FS_METHOD constant, you are instructing WordPress to use the direct method for file system operations instead of relying on FTP. This should bypass the need for FTP credentials on your localhost setup.