WordPress FTP connection setting for localhost to upload and install

Can’t upload file and install the plugin on the local host. Every time I click install button WordPress asking for connection information for the FTP credentials like this pic

enter image description here

What to do:

Firstly, give write permission to folders in your files

chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins/
chmod 777 /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/themes/

Second add this code to your wp-config.php

/** Add here*/
define("FTP_HOST", "localhost");
define("FTP_USER", my_wordpress_user”);
define("FTP_PASS", password”);
/** To here*/