Skip to content

Web Nerdism w/ PHP 101 › Before You Start

Tools

Phillip Harrington Nov 2026

Setup is the boring part. Let's get it over with. These aren't lessons. They're the handful of things you set up once and come back to when a lesson needs them. The course assumes you know your way around your own computer: installing an app, finding a file, getting into a folder. It won't walk you through where to click. If you've never opened a terminal, start at the top.

One rule runs through all of it: you install as little as possible on your own computer. Docker is the one real install. Everything else, PHP included, runs in a container.

The Terminal

A window where you type commands instead of clicking. On a Mac it's Terminal, in Applications, Utilities. On Linux, you already know.

On Windows, Windows Terminal opens PowerShell by default, which works differently from everything else in this course. Install WSL instead: run wsl --install in Windows Terminal once, restart, and you'll have Ubuntu, a real Linux, running inside Windows. Open its terminal, and every command in the course works exactly as written. Docker Desktop on Windows runs on WSL anyway.

Four things get you a long way:

  • pwd says which folder you're in.
  • ls lists what's in it.
  • cd some-folder goes into a folder, and cd .. goes back up.
  • Ctrl+C stops whatever is running.

The up arrow brings back the commands you typed before. And type the first few letters of a file or folder, then press Tab: the terminal finishes the name for you. If nothing happens, it isn't where you think it is.

I got serious about the terminal at my first job that had me wrangling CSV files all day, and I've run a few bad commands since. One of them I'm still too embarrassed to tell anyone about. Read a command before you press Enter, especially one that deletes.

Package Managers

For the few things that do have to live on your computer, use your system's package manager rather than downloading installers from websites. It installs, updates and removes things with one command each.

  • Mac: Homebrew. For example, brew install git.
  • Linux, including Ubuntu in WSL: apt, built in. For example, sudo apt install git.

Docker

Docker runs containers: small sealed boxes with exactly the software a lesson needs. When you're done, the box goes away, and nothing was installed on your machine. It's how every lesson runs PHP.

Why bother? Because I've done it the other way. At one job, most of our apps ran on a current PHP and one ran on an old one, so we had a pair of commands to switch which PHP Homebrew pointed at, and we had to remember to run them. At another, we renamed PHP's folder by hand to switch between versions 7 and 8 for different apps, because nobody had time to update the old ones. That lasted until a security hole made updating a priority, and then we got hacked anyway: one setting, left at its default in an old PDF library, opened the door for everything that followed. With containers, every app brings its own PHP, and nothing on your computer has to change.

Get Docker Desktop on a Mac or Windows (on a Mac, brew install --cask docker-desktop does it). On Linux, install Docker Engine with your package manager. Docker Desktop has to be running before any docker command works. Check it:

docker run --rm hello-world
docker
The Docker command. Everything after it is instructions.
run
Start a new container, run what's in it, and show you the output.
--rm
Remove the container when it's done, so they don't pile up.
hello-world
The image: what goes in the container. This one is Docker's tiny test image. Docker downloads an image the first time you use it, and reuses it after.

If it prints "Hello from Docker!", you're set.

Git

Install it with your package manager. On a Mac:

brew install git
brew
Homebrew, the package manager.
install
Download and install something.
git
The thing to install.

Git keeps the history of your code: every change, when, and why, so you can go back. Check it's there:

git --version
git
The Git command.
--version
Print which version is installed, and nothing else. If you get a version number, it's there.

The lessons use a few Git commands as they come up. For the whole thing, the free Pro Git book is the one.

Your Editor

Code is plain text, so you need a code editor, not a word processor. VS Code is free, and fine to start with. But if you're going to spend real time in PHP code, sincerely, get PhpStorm and learn it. It understands PHP all the way down, out of the box, where VS Code gets partway there with a pile of extensions. Students can get it free. I used it every day from 2012 until this year, when AI started doing the heavy lifting.

A word from an old programmer: don't be macho about this. Writing code in a bare text editor, or in a terminal editor you haven't learned yet, earns you nothing but typos and lost afternoons. Use the editor that helps you: the one that colors your code, finds things across files, and tells you about a mistake before you run it.

Your Browser's Developer Tools

Every browser has a set of tools for looking under the hood of a page. Open them with F12, or Cmd+Option+I on a Mac (Ctrl+Shift+I elsewhere). In Safari, first turn on Settings, Advanced, "Show features for web developers." The course uses four tabs:

  • Elements: the page's HTML, as the browser sees it right now.
  • Console: messages and errors from the page's JavaScript.
  • Network: every request the page makes, and every response.
  • Application in Chrome, Storage in Firefox: the cookies and everything else a site keeps in your browser.

Reading Logs

A log is a file a program writes lines to as things happen. Watching one while you click around is half of debugging. To follow a log as it grows:

tail -f some.log
tail
Show the last few lines of a file.
-f
Follow: keep the file open and print each new line as it's written, until you press Ctrl+C.
some.log
The file to watch.

less +F some.log does the same, and lets you scroll back: Ctrl+C to stop following, q to quit. lnav, from your package manager, adds color and search. For a container, docker logs -f and the container's name.

Composer, in a Container

Composer is PHP's package manager: it fetches the libraries a project uses. You'll run it in a container too, never installed:

docker run --rm -it -v "$PWD":/app -w /app composer:2 composer install

Only the new parts:

-it
Keep it interactive, so you see its output as it goes and can answer if it asks.
-v "$PWD":/app
Share the folder you're in ( $PWD) with the container, where it shows up as /app. That's how a container works on your files.
-w /app
Start in that folder, inside the container.
composer:2
The image: Composer, version 2.
composer install
The command to run in it.

The lessons that need Composer say so, and explain it there.

Don't make it harder than it has to be

You don't get points for doing it the hard way. Nobody grades you on being the biggest nerd in the room; you get points for getting shit done. This work carries plenty of mental load already, so take every bit of it off yourself that you can: the helpful editor, the shortcut, the tool that does it for you.

That's the setup. One more page before the first lesson: a quick key to reading the code in the examples.