I'm a bit of a newcomer to web development and I'm looking for the simplest way to set up a web server on my Mac. I initially thought MAMP would be the way to go, but I've been hitting some roadblocks with version compatibility issues that have prevented me from using MySQL. I even considered installing Apache, PHP, and MySQL individually, but I ran into another problem with PHP being deprecated on Macs. I want to focus on actually developing my website rather than troubleshooting these environment issues. Would something like Docker or Apple containers be a better option? I'm open to any suggestions or advice you might have!
5 Answers
Have you considered using XAMPP? It's pretty straightforward and I've never had issues with it on my Mac.
You might want to check out HERD. It's PHP-based, works great on Mac, and handles all the dependencies for you automatically!
Using Docker with Docker Compose for the entire stack is awesome because you won't have to install everything directly on your Mac. Plus, it's super easy to tear down and rebuild your stack whenever you need to adjust things. There are plenty of online guides to help set up Apache with PHP and MySQL, which is the standard for WordPress and should work well for you.
For backend development, you'll usually need to install a server-side language like Python, Node.js, or Java. Then, set up a database like MySQL or Postgres. You can use Docker containers for the database, but I find it easier to install it directly. If you’re dealing with HTML, decide if you want server-side rendering; if so, install the necessary libraries like Express or Django. Otherwise, consider using a modern JavaScript framework to separate the UI development from the backend.
Regarding Apple containers, they don't yet support Docker Compose files, which can be limiting if you want to run multiple containers, like a web server and a database. Docker along with Docker Compose is a solid choice right now. I'm looking forward to using Apple containers once they’re more stable!

Related Questions
How to Build a Custom GPT Journalist That Posts Directly to WordPress
Cloudflare Origin SSL Certificate Setup Guide
How To Effectively Monetize A Site With Ads