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.
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.
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.
Now, look for these 2 lines:
Change them to:
- 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.