Starting with macOS 12 (Monterey), PHP is no longer bundled with macOS. These instructions allow you to install PHP. The instructions were tested on an Apple Silicon Mac, but the process on an Intel Mac should be similar.
Homebrew is a popular package manager that makes it easy to install command line tools. If you don’t yet have Homebrew installed, instructions can be found here: https://brew.sh
Verify that Homebrew is installed: