Open-source project
shivammathur/homebrew-php avatar
shivammathur/homebrew-php

Fourteen PHP versions, four builds each, and a description that stops one short

Homebrew tap for PHP 5.6 to 8.6. PHP 8.6 is built nightly :beer:

2,877 stars182 forksRubyMIT

At a glance

What is it?
The tap publishes NTS, debug, ZTS and debug ZTS formulae for every PHP release from 5.6 to an 8.7 development build. Its own summary line still says the range ends at 8.6, and macOS on Intel gets nothing.
Who is it for?
homebrew-php is worth using when you need several PHP versions on one machine or need debug symbols to build an extension against, and both of those are the tap's actual specialty. Before you commit, check the row for your PHP version in the support table rather than the summary line, since the two disagree about the newest build, and confirm your platform is in the OS table because Intel macOS is excluded outright.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly Ruby, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • shivammathur/homebrew-php2,877 ★ · +3
Star history
Repository2026-10-042026-11-15
shivammathur/homebrew-php2.9k2.9k

3 Stars in the last 42 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The description ends at 8.6 while the table carries a 8.7.0-dev row

The support table is the authoritative part of this repository and it disagrees with the summary above it. That line describes a tap for PHP 5.6 to 8.6 and says PHP 8.6 is built nightly, but the table has fourteen version rows, from PHP 5.6 through PHP 8.4, then PHP 8.5, then two development rows labelled 8.6.0-dev and 8.7.0-dev. So the newest build is one version ahead of what the description claims, and neither dev row carries a release date in this repository at all. The repository publishes no GitHub releases either. Its declared homepage points at the packages page, which is where a tap's builds actually land. The tree holds four content directories, Aliases/, Formula/ and Scripts/ beside .github/, and no changelog file at the root.

One row of four formulae, where only 8.5 answers to the unversioned name

Every version in the table expands into four formulae, split on two axes. The first is thread safety, where the plain name is the non thread safe build and the zts suffix is the thread safe one, for applications that need multi threading support. The second is debug symbols, where the debug suffix exists for building or debugging PHP extensions. Both can be combined, which is where the debug-zts names come from. Only the PHP 8.5 row carries an unversioned alias, so `php` and `[email protected]` are two names for the same formula, as are `php-debug` and `[email protected]`, `php-zts` and `[email protected]`, and `php-debug-zts` and `[email protected]`. Every other version must be named with its number.

zsh
brew install shivammathur/php/[email protected]

From PHP 8.6 onward the numbered name is the only name a formula has.

Installation is three commands and trust is part of it

The tap needs Homebrew before it needs anything PHP. On macOS the listed prerequisite is the Xcode Command Line Tools, on Linux it is cURL and Git from either APT or Yum, and Homebrew itself is installed by piping its own installer through bash. After that the tap is fetched and marked trusted in one step, and the documentation is explicit that both actions are required.

zsh
brew tap shivammathur/php
brew trust shivammathur/php

Trust is the part worth pausing on. A third party tap is executable content that Homebrew will run, and this tap is Ruby scripts plus build definitions rather than prebuilt binaries, so the trust step is a decision about whose build recipes run on the machine. Nothing in this repository explains what trust changes about the tap's behaviour. The repository declares MIT for its own code and carries a second licence file, LICENSE_HOMEBREW, for the dependencies it pulls in.

Linking is what actually selects a version, and switching rewrites the link

Installing a formula does not put it on your path. A separate link step follows every install, with both the overwrite and force flags, and the same command with the same flags is what switches between versions later. That is the whole switching mechanism: several PHP versions live side by side in the Cellar and exactly one of them is linked.

zsh
brew link --overwrite --force shivammathur/php/[email protected]

The overwrite and force flags are there because the previously linked formula is in the way, and the documentation prints the exact warning Homebrew produces when that happens, naming a Cellar path and telling you to unlink first.

zsh
brew unlink [email protected]
brew link --overwrite --force shivammathur/php/[email protected]

Nothing in this repository documents a version manager on top of this, so the link is the only selection point the tap offers.

The debug variants are declared unfit for production

The one judgement the documentation makes about build variants is about debug. Formulae with debug symbols are for building or debugging PHP extensions, and the text says plainly that they are not recommended for production usage. The zts variants get a positive description instead, being for applications that require multi threading support. There is no guidance on what the debug build costs in memory or in runtime speed, no configuration difference to apply, and no indication of whether the debug and debug-zts formulae behave any differently from each other beyond the thread safety axis. A build directory that carries debug symbols for every one of fourteen versions is a large surface to choose from without measurements attached to any of it.

macOS Intel is excluded, and the OS table lists four platforms

The OS table is four rows and three of them are macOS names: Sequoia, Tahoe and Golden Gate, all arm64. Linux carries both x86_64 and arm64. Underneath the table there is one sentence with no hedging: macOS Intel is not supported. The badges at the top of the page claim Linux x86_64 and Apple M1 arm64 support and say nothing about Intel Macs, so an Intel user finds out from the table or not at all. Since the unversioned `php` name resolves to an arm64-only build on macOS, a machine that cannot run any formula in this tap also cannot run the bare `php` command another tap might provide, which makes a broken PATH harder to diagnose than it looks.

Troubleshooting reaches for a recursive chown on the Homebrew prefix

The debugging list starts with running brew update before installing and then running brew doctor, which is Homebrew's own diagnostic and can report anything. The next entry is a permissions repair that recursively changes ownership of the entire Homebrew prefix to the current user, invoked with sudo.

zsh
sudo chown -R "$(id -un)":"$(id -gn)" $(brew --prefix)

That is a broad change to a directory tree shared by every formula on the machine, offered as a fix for PHP specifically. The last two entries are narrower: a macOS update is treated as a reason to reinstall PHP with its dependencies, by expanding brew deps into the reinstall list, and anything still unresolved goes to a discussion thread.

zsh
brew reinstall $(brew deps shivammathur/php/[email protected]) shivammathur/php/[email protected]

Editorial conclusion

homebrew-php is worth using when you need several PHP versions on one machine or need debug symbols to build an extension against, and both of those are the tap's actual specialty. Before you commit, check the row for your PHP version in the support table rather than the summary line, since the two disagree about the newest build, and confirm your platform is in the OS table because Intel macOS is excluded outright. Set a command level timeout and a memory limit for the debug variants, since the documentation calls them unfit for production and does not say what they cost. If you came from the old homebrew/php tap, run the cleanup guide first, because leftover packages from it are a separate problem from anything in this repository.

Frequently asked questions

Which PHP version does the plain php command from homebrew-php install?

PHP 8.5. In the support table the 8.5 row is the only one with unversioned names, so php and [email protected] are the same formula, as are php-debug, php-zts and php-debug-zts. Every other version, from 5.6 to 8.7.0-dev, is only available under its numbered name.

Does homebrew-php support Intel Macs?

No. macOS Intel is not supported, and the OS table lists arm64 only for macOS Sequoia, Tahoe and Golden Gate. Linux is the platform with both x86_64 and arm64 builds.

Can homebrew-php formulae be used on a production server?

The plain and zts variants are not restricted, but the documentation states that formulae with debug symbols can be used when building or debugging PHP extensions and are not recommended for production usage.

Why does installing PHP from the homebrew-php tap need a separate link step?

Because install and selection are separate operations. brew install shivammathur/php/[email protected] puts the formula in the Cellar, and brew link --overwrite --force shivammathur/php/[email protected] is what puts it on your path. The same link command with the same flags is what switches versions afterwards.

Is homebrew-php still receiving new builds?

The repository is not archived and the last push to main is dated 2026-09-23. It publishes no GitHub releases, so versions are distributed as Homebrew packages rather than release assets, and the table carries development rows for 8.6.0-dev and 8.7.0-dev.

Official sources

  1. Issues
  2. License: MIT
  3. Project website
  4. README
  5. shivammathur/homebrew-php on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/shivammathur-homebrew-php.svg)](https://hysenlabs.com/projects/shivammathur-homebrew-php)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/shivammathur-homebrew-php.svg)](https://hysenlabs.com/projects/shivammathur-homebrew-php)

Was this useful?