r/PHPhelp • u/__josealonso • Sep 30 '26
Developer setup in macOS Golden Gate
Hello,
I am planning to learn PHP on my macOS system. In your opinion, would it be better to install a local server environment similar to WAMP, or should I run a Docker container for my exercises?
What is your preferred development setup?
Thank you in advance.
5
Upvotes
3
u/Intrepid-Ad-2306 Sep 30 '26
i see this question a lot cause i teach coding, php being one of the languages i focus on. if you want to learn about docker, you can certainly use this as an excuse but, from a usability perspective, there’s no advantage to it when it comes to learning about php and how it works in most real-world environments because that’s not typically how php is deployed.
if you just want to learn php, you can just use homebrew and install the latest php. it has its own built-in web server that you can spin up in any directory from the terminal by running “php -S localhost:port”. that’s incredibly useful when you want to just create all kinds of small learning projects in their own directories and run them. no need to create new virtual servers or complex configuration files or anything.
if you want to learn database integration and go deeper, you can choose your target type of environment. install mariadb and apache on your local machine if you like but you might find it more helpful and realistic to either use an old machine as a testing server with debian or almalinux and learn to set a server up from scratch as a testing environment or do it in a virtual machine like utm or virtualbox.
in development, there is a disagreement in the community about local vs test server development. i always come down on the side of a test server configured just like the production machine. instead of trying to simulate where you’re going to have the thing running, you duplicate it and now you know you’re testing against where the real bugs will show up. i’d get used to developing and testing on a real testing server as soon as you’re comfortable with it. i usually suggest switching from running the local php built-in web server to deploying a virtual or real test server with a very basic setup once you get to the point of understanding recursive functions and database calls in your learning.
docker has many excellent uses but using it for php on a local machine is just a lot of configuration headaches and needless frustration for something that’s not applicable to something that’s generally deployed natively anyway. one of the big advantages to php is that php projects usually just live as collections of text files that can be called by a server like apache or nginx without needing their own individual containerized existences or configurations.
6
u/__kkk1337__ Sep 30 '26
I use docker
1
u/__josealonso Sep 30 '26
Hello everyone,
I intend to set up a Linux test machine to facilitate the deployment of my exercises and accelerate my learning process. Additionally, I would like to learn how to configure a Docker container for a PHP project.
Thank you all for your comments, as they have been very helpful.
3
u/Ok-Crab-8788 Oct 03 '26
you can try ddev,
it is built on top of docker container, works with rancher-desktop, and provide you simple commands :
ddev start => https://myfolder.ddev.site
ddev snapshot create => dump database
Start with ddev init : https://ddev.com
2
u/Glittering_Case_5547 Sep 30 '26
If you are learning for professional purposes, docker is better.
Checkout Orbstack. It is faster than the normal docker setup
2
u/martinbean Sep 30 '26
I run everything I can in Docker on macOS. I then set up aliases for things like `php` and `composer` so I can use it as if it were installed on my machine.
2
u/BokuNoMaxi Sep 30 '26
If your focus is on learning PHP then install ddev with orbstack and you don't have to fiddle around with docker files and PHP paths, especially when it comes to different PHP versions.
2
u/Wooden-Pen8606 Sep 30 '26
Herd, Docker, or WAMP should be fine.
2
u/Apprehensive_Ebb_346 Sep 30 '26
Docker always
2
u/Visible-Big-7410 Oct 01 '26
Ahh personal preference. I prefer a docker setup, because I messed up enough in the past (I still do ha!) or that required switching php versions etc. and docker just makes the “let’s start fresh (w/o leftovers)” or “i need to test on x version” very easy. But as others have mentioned you also learn some docker. Nothing wrong with either. Direct is a little simpler and you’ll realize when or if you need/want containerization.
2
u/liy8 Oct 05 '26
Go with Yerd(has services(mariadb, postgres, etc....) & Orbstack(docker, kubernetes & linux machine in one place, also less resource hungry than docker desktop), also use nix for package management.
2
u/obstreperous_troll Oct 13 '26
My setup is Homebrew (using Shivam Mathur's tap for PHP) for quick messing around, Docker and/or Nix for serious projects. Definitely no global server for PHP, I have a traefik container that handles web server containers, so the only global listeners are things like Vite dev servers.
1
u/TemplerTreiff 6d ago
depends on your background tbh. If you already know your way around containers from other languages, go that route, otherwise stick to a basic local environment so you aren't debugging two new things at once.
1
u/mrdarknezz1 Sep 30 '26
I'm currently using https://lerd.sh/ it has every tool you could possibly need and it is free
0
u/universalpsykopath Sep 30 '26
Docker is great, but comes with a learning curve. It also won't be as fast as native. Maybe install php and nginx with homebrew?
1
u/[deleted] Oct 01 '26
[removed] — view removed comment
1
u/[deleted] Oct 03 '26
[removed] — view removed comment