Where apps hide your files
The native XAMPP installer for macOS keeps your web files in /Applications/XAMPP/xamppfiles/htdocs, with its config files under xamppfiles/etc. XAMPP-VM is laid out differently, so check which one you have first.
In the native XAMPP installer for macOS, the web root is:
/Applications/XAMPP/xamppfiles/htdocs
Anything you put there is served at http://localhost/. Apache Friends' macOS FAQ says XAMPP for OS X installs "below the /Applications/XAMPP directory" and puts every config file under xamppfiles; community guides give the xamppfiles/htdocs path above. To confirm it on your install, this prints the web root Apache is configured with and changes nothing:
grep -n '^DocumentRoot' /Applications/XAMPP/xamppfiles/etc/httpd.conf
If you use XAMPP-VM instead, nothing is on your Mac's disk in that form. The two builds are different products, so check which you have first. Neither is listed on Apache Friends' current download page, which offers Windows installers and an in-browser version, so on a Mac you are most likely working with an existing install.
Apache Friends describes the difference this way: XAMPP for OS X is a native installer that puts Apache, PHP and the other components in /Applications/XAMPP. XAMPP-VM runs the Linux build of XAMPP inside a virtual machine on your Mac.
/Applications/XAMPP/xamppfiles/htdocs and open http://localhost./opt/lampp/htdocs. Apache Friends' announcement for the VM says you reach them by mounting /opt/lampp from the stack manager's Volumes tab, which makes it appear in Finder, and that web port 80 is forwarded to port 8080 on your Mac, so you browse to http://localhost:8080.The quick test: if /Applications/XAMPP has a xamppfiles folder, you have the native build.
In Finder, choose Go > Go to Folder (⇧⌘G), paste the path and press Return. From Terminal:
open /Applications/XAMPP/xamppfiles/htdocs
Depending on how the installer set the folder's permissions, Finder may ask for an administrator password when you add files; ls -ld /Applications/XAMPP/xamppfiles/htdocs shows who owns it. Many developers keep their projects in ~/Sites or another folder and point Apache at it instead, which is a later section.
Apache Friends' macOS FAQ lists the main configuration files:
| File | Path |
|---|---|
| Apache | /Applications/XAMPP/xamppfiles/etc/httpd.conf |
| Apache, XAMPP extras | /Applications/XAMPP/xamppfiles/etc/extra/httpd-xampp.conf |
| PHP | /Applications/XAMPP/xamppfiles/etc/php.ini |
| MySQL/MariaDB | /Applications/XAMPP/xamppfiles/etc/my.cnf |
| ProFTPD | /Applications/XAMPP/xamppfiles/etc/proftpd.conf |
The FAQ also puts Apache's error log under /Applications/XAMPP/logs/error_log, and suggests tail -2 /Applications/XAMPP/logs/error_log when Apache will not start. Since XAMPP 5.5.30 and 5.6.14 the database is MariaDB, with the same commands and tools as MySQL.
The FAQ does not name the data folder. To find it without guessing, look for the datadir line in the config. This prints only that line:
grep datadir /Applications/XAMPP/xamppfiles/etc/my.cnf
If it prints nothing, MariaDB is using its compiled-in default. With MariaDB running, the query SELECT @@datadir; in phpMyAdmin's SQL tab prints the folder in use. Never copy these files while MariaDB is running; export with phpMyAdmin or mysqldump instead.
To serve a project folder of your own, stop Apache in XAMPP Control (the app is named manager-osx), make a copy of httpd.conf, then edit it. Community answers for macOS change the DocumentRoot line and the matching <Directory> line in httpd.conf to the new folder. Start Apache again afterwards. Folders under Desktop, Documents and Downloads are protected by macOS, so Apache can be denied access there; a folder such as ~/Sites avoids that.
Open http://localhost/ to check the change. To restore the original, stop Apache, put the backup copy of httpd.conf back and start it again. An "Access forbidden" page after the change usually points at the new folder's permissions (Apache must be able to read it) or the <Directory> block, not the DocumentRoot line.
XAMPP's installer places everything in one folder, so the whole of /Applications/XAMPP/xamppfiles is your install. Before an upgrade, copy your htdocs folder somewhere else, and export your databases from phpMyAdmin. Apache Friends does have a built-in backup command (sudo /Applications/XAMPP/xamppfiles/xampp backup), but its FAQ marks that feature as still under development and says it may not work correctly, so do not rely on it as your only copy.
The FAQ is blunt that XAMPP is for development, not production. By default the MySQL root user has no password, the MySQL daemon is reachable over the network, and ProFTPD uses the password lampp. The FAQ's fix is a short interactive check that sets passwords; run it and answer its prompts:
sudo /Applications/XAMPP/xamppfiles/xampp security
/Applications/XAMPP is a normal folder, but xamppfiles is deep inside, and the etc and logs folders are full of names such as httpd.conf and php.ini that also belong to other copies: macOS ships its own Apache with /etc/apache2/httpd.conf, and a Homebrew PHP brings another php.ini. Searching by file name in Finder returns every copy without showing which belongs to XAMPP, and a project buried several folders down is easy to lose.
Type php.ini or httpd.conf into Everywhere and the results show every copy with its folder, so you can tell XAMPP's from any other on the Mac. Type your project's name to jump to it, then press ⌘T to open a Terminal in that folder. It matches names only, not the lines inside a config file.
At /Applications/XAMPP/xamppfiles/htdocs for the native installer. In XAMPP-VM it is /opt/lampp/htdocs inside the virtual machine.
At /Applications/XAMPP/xamppfiles/etc/php.ini, according to Apache Friends' macOS FAQ. Restart Apache from XAMPP Control after editing it.
XAMPP for OS X installs Apache, PHP and the rest natively in /Applications/XAMPP. XAMPP-VM runs the Linux build in a virtual machine, and its web port is forwarded to 8080 on your Mac.
Back up xamppfiles/etc/httpd.conf, change DocumentRoot and the matching <Directory> line to your folder, and restart Apache. Avoid Desktop, Documents and Downloads, which macOS protects.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised