How to Fix FTP Login Problem in WordPress in XAMPP for Mac OS (Localhost)

Posted in Apple/Mac , Web Development on 12 July 2011 24 comments

If you are using XAMPP for Mac OS like me, and was asked to enter FTP login information when you upgrade WordPress core and download themes or plugins, then this guide is for you. After searching for solution online, I found that this is a permission problem due to your Mac’s username is different compared to the default user name in XAMPP for Mac, called nobody.

As far as I understand, this has nothing to do with FTP settings. This problem occurs because the Apache HTTP service was being run as “nobody” while your Mac user name is a different name. Thus, it has no permission to add/edit your server files so WordPress attempted to use FTP to perform its job.

Editing httpd.conf as Admin

First of all, editing this file is not as easy as using a text editor program and edit it because this read-only file can only be changed by root or superuser, not even administrator. There are 2 or more methods that you use to edit such file:

1. Edit using vi editor in sudo mode using Terminal
2. Run Mac OS TextEditor in sudo mode using Terminal and edit the file

- Terminal is a command line tool just like Window’s CMD.
- Sudo mode refers to running the file as superuser or root.
- Vi editor is a command line editor that is very not user-friendly to use, edit and save (at least for beginner)

Thus we will use Method 2 to perform this task.

1. Run Mac OS TextEditor application in sudo mode using Terminal and edit the file

First of all, open up your Terminal by typing “Terminal” in your Spotlight search box (upper right corner)

Once the terminal is loaded, type this in: (copy and paste if possible)

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /Applications/XAMPP/etc/httpd.conf

- sudo command will run the TextEdit application as root
- Seperated by a space after the application path, is the path of httpd.conf (the file to edit)

Press enter, a TextEdit window should pop up and you can then freely edit the file as root.

2. Change the user name and group name

Now, look for these 2 lines:

User nobody
Group admin

Change them to:

User your-mac-username
Group staff

- Staff is the non-admin user group in Mac.
- If you are not sure about your mac username, open Finder > go to Macintosh HD > Users > Look for your folder’s name.

Now restart your XAMPP apache server and it should be working perfectly.

 

Posted by Zen on 12 July 2011 24 comments
Tags : , ,



or Subscribe to specific category only :




  - 24 Comments


zafer says:

Hi, Really nice website I like your way of writing blogs.

Mark Dooley says:

Thanks! I was able to edit the file w/ textedit by changing permissions on the file. I got errors via the terminal. I just upgraded to Lion so I dont know if that has anything to do with it, but the file edit solved the wordpress ftp localhost on xampp issue. Also used xammp as password. proceeded to update to 3.2.1 core and all plugins and themes. So happy I found your post!

Ivan says:

Best and easy solution. The only diference I did, was just use the first argument in terminal, TextEdit pop, then find the file in XAMPP folder > open > unlock > edit > save.

Will says:

After a few hours of searching, I came across this, the one WORKING solution to the problem.

Thanks so much.

Philip Arthur Moore says:

Works like a charm. I had some trouble launching TextEdit so I used `sudo nano httpd.conf` instead. Cheers.

Dave says:

Hey Zen,

Thanks sooooo much for your post. It was really helpful and solved my problem!

Saved me a lot of time trawling the net!

Cheers,
Dave

Victor Abadio says:

VERY useful. Thank you!

Gaye Smith says:

I second Will’s comment and all the other glowing comments here! This was the post that finally worked for me – thank you so much! The only thing I didn’t remember how to do was get back to the proper prompt in Terminal. I just closed it, so hope that was okay. Again, thank you. I thought there must be a simpler solution than some made it out to be!

Alek says:

Thanks a million. I’m new to Mac and switching from Joomla to WordPress and was about to give-up when I finally discovered your port. Now, my FTP connection from XAMPP works and I am able to work on WordPress while disconnected. Thks again.

Andres says:

Thanks! works great!

kareem says:

Great! This is exactly what i was looking for.

mucsia says:

Thanks! It works fine.

Felix says:

Thanks a lot. Under OS X Lion I had some trouble to open the file from the Terminal. I just use the first line of code to open the TextEdit and then open the file manually. Works just fine. I only have to change my user name, because I had a space in it. Xampp don’t like that :)

Leo says:

Thanks very much! I spent over an hour trying to fix this. It was my username in the terminal.

Daniel says:

Works great! In lion I had to just use…

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit

Then located the file and then changed and saved it.

Brad says:

Worked Great! I am know being prompted for a username and password when I upload images and nothing seems to work. Can anyone help:

ERROR:
The user name or password you entered for area “WP-Files” on localhost:80 was incorrect. Make sure you’re entering them correctly, and then try again.

Senica says:

Ha! Awesome! So simple. This has been driving me crazy. It was like this on OSX 10.7 and I just manually installed everything as I could never find the correct answer. I upgraded to 10.8 and had to restore some stuff from time machine and had to alter a few config files so I thought I would google it again. Thanks for the correct answer.

ale says:

Hi,
I just installed it… Turned apache off by using the xampp control panel and tried to turn it back on it gives the error: XAMPP’s Apache can not start while another webserver is using port 80. Please turn it off and try again. Any ideas? I restarted all of xampp and any internet browsers. I will restart the whole computer.

ale says:

Thanks… It works now :) I will follow this blog now, I never knew it existed, you need to get an sep team to promote your site and get high up on google. If you do with content this high-quality you’re blog could be the next noupe :) Hope you get more visitors!

ale says:

I mistyped or my mac auto-corrected (again) I mean an seo team…

Robert Rodriguez JR says:

Still doesn’t work for me – followed instructions but no luck, I’m on Mt. Lion – any suggestions? thanks

Trackbacks

  1. How to Fix FTP Login Problem in WordPress in XAMPP for OS X? « b1oque dashboard
  2. XAMPP Wordpress FTP password on Mac OS X | ohsomuchwork
  3. Mac OS: Memperbaiki masalah FTP login di WordPress pada XAMPP (localhost)Inside Our Minds

Leave a Reply

You must be logged in to post a comment.

Previous Post
«
Next Post
»