XAMPP for Mac is currently one of the most popular PHP development environments. It is a free, easy-to-install Apache distribution that includes MySQL, PHP, and Perl. The open-source nature of the XAMPP package makes it incredibly simple to set up and use. As an all-in-one Apache suite, XAMPP comes with Apache, MySQL, PHP, and Perl. It can be extracted directly without a complicated installation process, making it highly recommended for beginners. To date, XAMPP supports four versions: Windows, Linux, Mac OS X, and Solaris.
Software Features
As a system administrator, log in and extract the downloaded package to any directory on the server (excluding directories with Chinese characters), such as the root of the C drive.
Double-click the setup_xampp.bat
file in the directory to initialize XAMPP. Then, run xampp-control.exe
to start or stop modules like Apache and MySQL, and to register them as services.
Switching between PHP 5 and PHP 4
Starting from version 1.4.7, XAMPP supports optional startup for PHP 5 and PHP 4, allowing users to choose based on their PHP application requirements.
Run the php-switch.bat
file in the root directory to enter the PHP switch command prompt.
To switch to PHP 4:
Enter 4
in the command prompt.
To switch to PHP 5:
Enter 5
in the command prompt.
Moving the entire environment to another location (moving to another directory or server)
Run the setup_xampp.bat
file in the root directory to enter the command prompt, and select 1
to reinitialize the environment.
Note: If you have enabled virtual hosts, you will need to recheck if the relative paths in the virtual host configuration files are correct (if absolute paths are set, there is no need to check).

Installation Steps
After downloading, use software like Stuffit Expander to extract the package and then double-click the pkg
file:
The MacOS installer will launch and prompt you to click "Continue." The installer will also ask for the administrator password. Once the installation is complete, the MacOS X version of XAMPP will be installed in the /Applications/xampp
directory.
That's it. XAMPP is now installed in the /Applications/XAMPP
directory.
To start running XAMPP, follow these steps:
Login to the terminal as the system administrator (root):
sudo su
Use the following command to start XAMPP:
/Applications/XAMPP/xamppfiles/xampp start
You should see a message similar to the following on the screen:
Starting XAMPP for MacOS X 1.8.2...
XAMPP: Starting Apache with SSL (and PHP5)...
XAMPP: Starting MySQL...
XAMPP: Starting ProFTPD...
XAMPP for MacOS X started.
That's it. Apache and MySQL are now running.
If you encounter any error messages, please refer to the MacOS X FAQ.
Testing
It's simple to check if all components are working properly. Just enter the following link in your browser:
http://localhost
You should now see the XAMPP start page, which includes links to check the status of the installed software and some example programs.