Install PHP 8.5 on macOS
| Homebrew | |
| Install with brew | |
| Verify with php -v | |
| PATH notes |
Homebrew
Homebrew is the package manager most macOS developers use, and the fastest way to get a fresh PHP. Install the Homebrew tool itself first with its documented one line setup, then every PHP upgrade is a single brew command.
The App Store is not involved: everything below runs in the terminal.
Install with brew
Install PHP with one command:
Install PHP with Homebrew
brew install php
Homebrew fetches the current PHP build with its dependencies and links the binaries for you. Wait until the command finishes before opening a new terminal.
Verify with php -v
Check the version first:
Show the installed PHP version
php -v
PHP 8.5.0 (cli) (built: Nov 2026) (NTS) Copyright (c) The PHP Group
Then confirm which binary the shell picks:
Show which PHP binary runs
which php
/opt/homebrew/bin/php
PATH notes
If which php points at the system binary instead of the Homebrew folder, the shell PATH order needs a fix. Add /opt/homebrew/bin to the front of PATH in your shell profile, restart the terminal, and run which php again.
Every new terminal reads the profile on start, so the fix applies everywhere at once.
Next: Install PHP 8.5 on FreeBSD
Article author: Arthur Isaev