For PHP development XAMPP is the most necessary open-source software. It gives an environment where you get PHP and MySQL together in one place. The XAMPP provides the PHP configuration as well. So, you can manage the php.ini configuration file from there. If you don’t want to go with this, you must have to install it separately. For Linux, you need to have a LAMP setup consisting of Apache, MySQL, and PHP. These all will have separate installations. Now, it’s up to you to opt for either separate installations or with XAMPP. It is available for all the platforms like Windows, Linux, and MacOS.
For installing XAMPP in MacOS, you must have the MacOS system ready.
Download and Install XAMPP in MacOS
At the very first, you have to visit the official site of XAMPP. In the Download option, you will have to choose XAMPP for OS X.
After downloading, we will install XAMPP in MacOS. Simply navigate to the Downloads folder and double click on the installer file.
A dialog prompt will appear to install Rosetta. This is needed to open xampp in OSX.
So, you have to install it. You will require to allow the installation as well. Once, it is done, you can now proceed XAMPP installation.
The XAMPP installation wizard is ready and you have to follow the simple installation steps as you do in regular installation.
After completing the XAMPP installation, you can launch the XAMPP control panel.
Launch XAMPP Control Panel
In the XAMPP Control panel, you will have the multiple options. From here, you can navigate to the htdocs folder, and you can visit the phpMyAdmin as well for managing databases.
In the next tab, we have Manage Servers option. From here, you can start Apache, MySQL and FTP services. Before starting Apache and MySQL services, please make sure, you don’t have the default Apache services enabled by MacOS. Similarly, for the MySQL. If you already installed the MySQL server then multiple instances cannot be run together.
So, you have to take care of this.
In my case, I have disabled default Apache services using command line.
sudo apachectl stop
Here, I have disabled default Apache service in MacOS so that I can enable it from XAMPP Control panel.
So, now, come back to the XAMPP Control panel and inside Manage Servers tab, just start the MySQL and Apache server. In the below screenshot, you can see MySQL and Apache service is running.
So, now, you can open localhost in the browser to test the Apache and MySQL services.
You can visit PHPinfo for the details of installed PHP version and extensions.
You can enable PHP extensions as per your requirement. This option is available in php.ini configuration file.
You can launch the XAMPP control panel directly from the launchpad. Inside the launchpad, you will have the XAMPP folder. Then inside the folder, you will have manager-osx.
Simply click on the manager-osx option. It will open the XAMPP control panel.
So, that’s it for this post. I hope you will find helpful to this post.