Prebuilt Homebrew PHP packages for fast installation on macOS, used by setup-php. Packages include PHP and its required dependencies. Installation preserves existing PHP versions, configuration and services.
| PHP versions | Updates |
|---|---|
| 5.6 | Stable releases |
| 7.0 | Stable releases |
| 7.1 | Stable releases |
| 7.2 | Stable releases |
| 7.3 | Stable releases |
| 7.4 | Stable releases |
| 8.0 | Stable releases |
| 8.1 | Stable releases |
| 8.2 | Stable releases |
| 8.3 | Stable releases |
| 8.4 | Stable releases |
| 8.5 | Stable releases |
| 8.6 | Nightly |
| 8.7 | Nightly |
Every version is available in release and debug builds, with NTS and ZTS variants. Apple Silicon (ARM64) and Intel (x86_64) require macOS 15 or later.
| Extension | PHP versions | Availability |
|---|---|---|
| Xdebug | All supported versions | Included |
| PCOV | 7.1 to 8.7 | Included |
| Redis, igbinary, msgpack | All supported versions | Optional |
| AMQP, YAML, SSH2, RdKafka | All supported versions | Optional |
| APCu | All supported versions | Optional |
| Imagick | All supported versions | Optional |
| MongoDB | All supported versions | Optional |
| Memcached, igbinary, msgpack | All supported versions | Optional |
| Swoole | 5.6 to 8.5 | Optional |
Use setup-php in GitHub Actions:
- uses: shivammathur/setup-php@v2 with: php-version: '8.4' extensions: apcu, imagick, mongodb, memcached, swoole, redis, amqp, yaml, ssh2, rdkafka
Direct installation requires Homebrew, jq, and zstd. Install missing tools
with brew install jq zstd, then run:
curl --fail --location --output install.sh \ https://github.com/shivammathur/php-darwin/releases/download/php-8.4/install.sh bash install.sh 8.4 release nts
To include optional packs:
bash install.sh 8.4 release nts "" "apcu, imagick, mongodb, memcached, swoole, redis, amqp, yaml, ssh2, rdkafka"
Downloads use GitHub Releases with a checksum-verified Cloudflare fallback. Homebrew installs and links the selected PHP as the default.
MIT.