I tried to install Elementor plugin for wordpress on Mac in localhost, but the installation has failed. These are the details:
Hostname: /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins
Ftp Username: root
Password:
With password I got this error alert:
Failed to connect to FTP Server /Applications/XAMPP/xamppfiles/htdocs/wordpress/wp-content/plugins:21
With no password I got this error alert:
Unable to connect to the filesystem. Please confirm your credentials.
I search for similar cases and found that I have to add this line to the code:
define('FS_METHOD','direct’);
and then I got this message:
Installation failed. could not create directory.
I’m not familiar with code writing, and I’m new to WordPress, I would greatly appreciate your help.
Regards
8
Answers
It’s probably due to lack of required filesystem permissions. Try this:
sudo chown -R www-data:www-data /var/www
I also had this issue. Solution is go to applications/xampp/htdocs and right click on the wordpress folder on which you are trying to install plug-in or theme. click get info, scroll to bottom, click on the lock to unlock it and type in your password and enter, in sharing and permissions allow privilege to system,admin and everyone and click on the setting icon in bottom left and apply to enclosed items.
try this command as it will not expose your entire html to hackers and this works in my case
Macbook Solution:
Step 1:
edit
/Applications/XAMPP/xamppfiles/etc/httpd.conf
and replaceto
after Step 1, you need to restart xampp, if you do not get your problem solve than follow Step 2
Step 2:
run this command
OR
Ubuntu Solution:
run this command on terminal
I see this error on Macbook, so I handle it the same as @Muhammad Numan instructed. Now, it worked
Step 1:
edit /Applications/XAMPP/xamppfiles/etc/httpd.conf and replace
User daemon
Group daemon
to
User YOUR_MACBOOK_USER_NAME // apple
Group GROUP_NAME // admin
This is an easy way without any commands, Add this code in wp-config.php anywhere.
This works for my mac !!
define( 'FS_METHOD', 'direct' );
sudo chmod -R 777 /Applications/XAMPP
Done
give the permissions
use the following commands: