Installing XAMPP on Mac

If you want to quickly get started with learning PHP (like I’m doing right now), you need a local server to test what you’re building. XAMPP is an open-source web server solution stack that allows you to do so. It comes with PHP, MariaDB (mySQL), Apache, etc. installed.

For Mac, there is a virtual machine version called XAMPP-vm which makes it easier and more secure to run XAMPP on your computer. You can read the details here: https://www.apachefriends.org/blog/new_xampp_20170628.html

How to install XAMPP-vm

The most common way is to go to https://www.apachefriends.org/ and download the XAMPP for OS X version.I’ve noticed that XAMPP-vm is the default recommended version, so there’s not really a difference between downloading and installing XAMPP or XAMPP-vm.

Personally, I ran into some issues with this installation method. For some reason it always wanted to download as some kind of archived folder instead of a .dmg file. I have no idea why, and looking at the website today it just looks like the standard .dmg installer file. 

So anywho. If you run into an issue similar to mine, there is an alternative way to download XAMPP-vm for Mac. Once again, homebrew came to the rescue.

Read my blogpost on why developers on Mac need Homebrew.

You can simply install xampp-vm via homebrew. Installation is simple, as per usual all you need is to input one installation command in your Terminal.

You can find it here: https://formulae.brew.sh/cask/xampp-vm

How to get started with XAMPP-vm

To get up and running with the stack installer and htdocs, I followed this video from Christian Hur. His explanation is very clear and you can easily follow along.

One tip: create a new folder in htdocs to keep your projects separate from the default files in htdocs. I then dragged that new folder from the finder to Visual Studio Code in my dock. This way the folder opens directly in VSC and you can start creating your php files from there.

Big Sur update problem

This is your reminder to regularly backup your files. Because I didn’t and proceeded to update my Mac to the latest Big Sur update. Big mistake because after the update, XAMPP didn’t want to run.

I ran into the following error:

Error starting “XAMPP” stack: Cannot calculate MAC Address

I was able to fix it with this blogpost on pookidevs: https://pookidevs.com/solved-error-starting-xampp-stack-cannot-calculate-mac-address/

Luckily I didn’t lose any of my coding assignments. But still, back up your files people. And use Github.

Leave a Reply