Setting up a local web server on a Mac
These instructions are slightly different for each version of macOS. Please see the User Tip appropriate for your macOS version.
Setting up a local web server on MacOS X 10.6 "Snow Leopard"
Setting up a local web server on MacOS X 10.7 "Lion"
Setting up a local web server on OS X 10.8 "Mountain Lion"
Setting up a local web server on OS X 10.9 "Mavericks"
Setting up a local web server on OS X 10.10 "Yosemite"
Setting up a local web server on OS X 10.11 "El Capitan"
Setting up a local web server on macOS 10.12 "Sierra"
Setting up a local web server on macOS 10.13 "High Sierra"
Setting up a local web server on macOS 10.14 “Mojave”
Setting up a local web server on macOS 10.15 “Catalina”
Setting up a local web server on macOS 11 “Big Sur”
Setting up a local web server on macOS 12 “Monterey”
Setting up a local web server on macOS 13 “Ventura”
Setting up a local web server on macOS 14 “Sonoma”
May 4, 2013 11:51 PM
Great guide, thanks John.
Just a note, in case anyone has the same issue. At first I couldn't get this to work. I tried logging out and back in (still no joy), then restarting the mac (still no joy).
Try doing both of those first. However, if, like me, you still can't get the local host site to load, try the following: You should find a file at /Library/WebServer/Documents/index.html.en . This contains the text "It works!" referred to in the post. What I did was duplicate that file in the same folder and changed the duplicate's name to 'index.html', leaving the original in situ.
Both local and user sites then loaded. After which, I was able to delete the duplicated file and everything now works without issue. Just to be clear, leave the original file index.html.en where it is, untouched and unharmed throughout this step.
Not sure why I had to take this mysterious detour - probably something local to my machine, but if you're having trouble after following the guide above, see if it helps.
May 4, 2013 11:51 PM
Dec 30, 2016 7:00 PM
Testing user tips
Dec 30, 2016 7:00 PM
Mar 26, 2018 4:51 PM
Hi Etresoft. On my new iMac, with OS 10.13.3, the php version is 7. I had to tweak a few things to get 5.6
Mar 26, 2018 4:51 PM
Mar 26, 2018 5:12 PM
When did that happen? I updated that for High Sierra. Oh well, I've updated it again. Thanks!
Mar 26, 2018 5:12 PM