skip to Main Content

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


  1. It’s probably due to lack of required filesystem permissions. Try this:

    sudo chown -R www-data:www-data /var/www

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. try this command as it will not expose your entire html to hackers and this works in my case

    sudo chown -R www-data:www-data /var/www/html/your-project-name
    
    Login or Signup to reply.
  4. Macbook Solution:

    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
    

    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

    sudo chown -R YOUR_MACBOOK_USER_NAME:GROUP_NAME /Applications/XAMPP/xamppfiles
    
    // like this
    
    sudo chown -R apple:admin /Applications/XAMPP/xamppfiles
    

    OR

    sudo chmod -R 777 /Applications/XAMPP
    

    Ubuntu Solution:

    run this command on terminal

    sudo chown -R www-data:www-data /var/www
    
    
    Login or Signup to reply.
  5. 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

    Login or Signup to reply.
  6. This is an easy way without any commands, Add this code in wp-config.php anywhere.

    define( 'FS_METHOD', 'direct' );
    
    Login or Signup to reply.
  7. This works for my mac !!

    1. In wp-config.php,add this define( 'FS_METHOD', 'direct' );
    2. In command line, execute sudo chmod -R 777 /Applications/XAMPP

    Done

    Login or Signup to reply.
  8. give the permissions
    use the following commands:

    sudo chown -R www-data:www-data /var/www/html;
    
    sudo find . -type d -exec chmod 755 {} /;
    
    sudo find . -type f -exec chmod 644 {} /;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search