You open config.inc.php on your Mac, make your edit, hit save — and nothing happens. Finder shows the file is owned by daemon with Read & Write, while everyone only gets Read Only. So you unlock the file in Get Info, flip everyone to Read & Write, save successfully… and then http://localhost/phpmyadmin stops loading.
That frustrating loop has a clean fix, and it takes about 30 seconds in Terminal. The trick is understanding that phpMyAdmin deliberately blocks itself when its config file is writable by "everyone." Let's fix the ownership instead of loosening the permissions.
Why "config.inc.php" Is Locked on macOS
When MAMP, XAMPP, or a Homebrew install sets up phpMyAdmin, the web server process creates and owns the configuration file. On macOS that process typically runs as the system user daemon.
Because your Mac login account is not the owner and not in the owning group, the only permission that applies to you is the everyone entry — which is Read Only. That is exactly what Finder shows you:
- daemon — Read & Write (the owner, i.e. the web server)
- staff or daemon group — Read & Write
- everyone — Read Only ← this is the one you fall into
In Unix terms the file is usually 644 or 664, owned by daemon. Nothing is broken. You simply don't own the file.
The Trap: "everyone: Read & Write" Breaks phpMyAdmin
When you change everyone to Read & Write in Finder's Get Info panel, the file's mode becomes 666 (or worse). You can now save your edit — but on the next page load phpMyAdmin runs a security check on its own configuration file and refuses to start:
Wrong permissions on configuration file, should not be world writable!
This is a deliberate hardening feature. A world-writable config file could be modified by any user or process on the machine, which is a serious risk for a tool that holds your database credentials. So phpMyAdmin kills the request before it renders.
Never set config.inc.php to 666 or 777. It will either break phpMyAdmin outright or leave your MySQL credentials exposed. The correct target is 644 — owner writes, everyone else reads.
The Correct Fix: Take Ownership (Recommended)
Instead of giving the whole world write access, give yourself ownership and restore the normal 644 permissions. phpMyAdmin keeps working and you can edit and save the file freely.
Step 1 — Open Terminal
Press Command + Space, type Terminal, and hit Enter.
Step 2 — Change the owner and the mode
Run these two commands. The $(whoami) part automatically inserts your Mac username, so you can copy and paste as-is:
sudo chown $(whoami):staff /Applications/MAMP/bin/phpMyAdmin/config.inc.php
sudo chmod 644 /Applications/MAMP/bin/phpMyAdmin/config.inc.php
You'll be asked for your Mac password. As you type it, nothing appears on screen — that's normal. Type it and press Enter.
Using XAMPP instead? Swap in the XAMPP path:
sudo chown $(whoami):staff /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php
sudo chmod 644 /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php
Step 3 — Verify
Check the result with:
ls -l /Applications/MAMP/bin/phpMyAdmin/config.inc.php
You want to see something like this — your username as owner, and -rw-r--r-- at the front:
-rw-r--r-- 1 yourname staff 24576 12 Jan 10:04 config.inc.php
Step 4 — Restart your local server and test
Quit MAMP (or XAMPP) completely and start it again, then visit http://localhost/phpmyadmin (MAMP users often need http://localhost:8888/phpMyAdmin).
Now open the file in your editor, make your change, and save. It works — and phpMyAdmin still loads.
Alternative Fix: Edit with sudo (No Ownership Change)
If you'd rather not change who owns the file, just edit it as the superuser. The permissions stay at the safe 644 the whole time.
sudo nano /Applications/MAMP/bin/phpMyAdmin/config.inc.php
Make your edits, then press Control + O, hit Enter to confirm the filename, and press Control + X to exit.
You can also open it in TextEdit with elevated rights:
sudo open -e /Applications/MAMP/bin/phpMyAdmin/config.inc.php
One caveat: this only works for a single edit session. If you'll be tweaking the file regularly, the ownership fix above is far more convenient.
Alternative Fix: ACLs (Keep daemon as Owner)
macOS supports access control lists, which let you grant your account write access without changing the owner or the POSIX mode bits. Because the mode stays at 644, phpMyAdmin's world-writable check passes.
sudo chmod +a "$(whoami) allow read,write" /Applications/MAMP/bin/phpMyAdmin/config.inc.php
This is the most surgical option if something in your setup depends on daemon owning that file.
Alternative Fix: Finder Get Info (GUI Only)
If you prefer to avoid Terminal entirely, you can do it in Finder — but you must change the owner, not the everyone row.
- Right-click
config.inc.phpand choose Get Info. - Click the padlock at the bottom right and enter your admin password.
- In Sharing & Permissions, click the + button and add your own user account.
- Set your account to Read & Write.
- Set the daemon row to Read only if you like.
- Leave "everyone" set to Read only. Do not touch it.
- Close the Get Info window and try saving your edit again.
Finder sometimes doesn't list your account at all. Click the + button and add it from the user list before changing anything.
Where Is config.inc.php on Your Mac?
| Setup | Path to config.inc.php |
|---|---|
| MAMP | /Applications/MAMP/bin/phpMyAdmin/config.inc.php |
| MAMP PRO | /Applications/MAMP/bin/phpMyAdmin/config.inc.php |
| XAMPP | /Applications/XAMPP/xamppfiles/phpmyadmin/config.inc.php |
| Homebrew (Apple Silicon) | /opt/homebrew/share/phpmyadmin/config.inc.php |
| Homebrew (Intel) | /usr/local/share/phpmyadmin/config.inc.php |
Not sure where yours lives? Let Terminal find it:
sudo find / -name "config.inc.php" -path "*phpMyAdmin*" 2>/dev/null
Quick Reference: Permission Cheat Sheet
| Mode | Meaning | Works? |
|---|---|---|
644 | Owner read/write, group read, others read | ✅ Correct target |
664 | Owner + group read/write, others read | ✅ Usually fine |
666 | Everyone read/write | ❌ phpMyAdmin blocks it |
777 | Everyone full access | ❌ Blocked and insecure |
Frequently Asked Questions
Why does phpMyAdmin say my config file is "world writable"?
Because the file's permission mode allows users other than the owner to write to it. phpMyAdmin checks this at startup as a security measure. Setting the mode back to 644 resolves it immediately.
Why is config.inc.php owned by daemon in the first place?
The local web server process runs as the macOS system user daemon, and it created the file during installation. That's normal behaviour for MAMP and XAMPP, not a sign of a corrupted install.
Can I just set the file to 777 and be done with it?
No. It stores your MySQL username and password in plain text. A world-writable config on a machine that's ever exposed to a network is a real security hole, and phpMyAdmin will refuse to run anyway.
I edited the file but phpMyAdmin still uses the old settings. Why?
Three common causes: you edited a different phpMyAdmin copy (many Macs have two or three), the web server is caching the old config, or you haven't restarted MAMP/XAMPP. Quit the app fully from the menu bar — not just the window — and relaunch.
Do I have to repeat this after every MAMP update?
Sometimes. A major MAMP upgrade can replace or recreate the phpMyAdmin folder with fresh permissions. If the problem returns, re-run the chown and chmod commands.
Terminal says "Operation not permitted." What now?
Your Terminal app needs full disk access. Go to System Settings → Privacy & Security → Full Disk Access, enable Terminal (or iTerm), then quit and reopen Terminal and try the command again.
Does this work on Apple Silicon Macs?
Yes. The commands are identical — only the Homebrew installation path differs (/opt/homebrew instead of /usr/local).
Wrapping Up
The permission problem on macOS comes down to one misunderstanding: the file isn't locked, you're just not its owner. Flipping everyone to Read & Write feels like the obvious fix, but it trips phpMyAdmin's world-writable security check and takes your local server down with it.
Run these two lines instead, and both problems disappear at once:
sudo chown $(whoami):staff /Applications/MAMP/bin/phpMyAdmin/config.inc.php
sudo chmod 644 /Applications/MAMP/bin/phpMyAdmin/config.inc.php
You get a file you can edit and save whenever you want, phpMyAdmin keeps loading, and your database credentials stay exactly as private as they should be.


0 Comments: