Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
H

homebrew-php

> 编程语言
Open source

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

2.9K stars0 likes0 views
WebsiteGitHub

About

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

brew tap shivammathur/php

## PHP Support | PHP Version | NTS Formula | Debug Formula | ZTS Formula | Debug ZTS Formula | |---------------|--------------------|--------------------------------|----------------------------|----------------------------------------| | PHP 5.6 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 7.0 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 7.1 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 7.2 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 7.3 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 7.4 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.0 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.1 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.2 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.3 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.4 | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | | PHP 8.5 | `php` or `[email protected]` | `php-debug` or `[email protected]` | `php-zts` or `[email protected]` | `php-debug-zts` or `[email protected]` | | PHP 8.6.0-dev | `[email protected]` | `[email protected]` | `[email protected]` | `[email protected]` | For each PHP version, we have formulae with thread-safety support `(zts)` and debug symbols support `(debug)` and both `(debug-zts)` as well. The formulae with debug symbols can be used when building or debugging PHP extensions and are not recommended for production usage. The formulae with thread-safety support can be used with applications that require multi-threading support. ## OS Support | Operating System | Architecture | |------------------|-------------------| | Linux | `x86_64`, `arm64` | | macOS Sequoia | `arm64` | | macOS Tahoe | `arm64` | | macOS Golden Gate | `arm64` | macOS Intel is not supported. ## Usage ### Prerequisites - On macOS, install Xcode Command Line Utilities: ```zsh xcode-select --install ``` - On Linux, install cURL and Git: ```bash # Using APT sudo apt-get install -y curl git # Using Yum sudo yum install -y curl git ``` - Install Homebrew: ```zsh /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/main/install.sh)" ``` - If previously installed, update homebrew and the formulae: ```zsh brew update ``` - If you have packages from old `homebrew/php` tap, refer to [this guide](https://github.com/shivammathur/homebrew-php/wiki/Cleanup) for removing them. ### Add this tap Fetch the formulae in this tap and mark the tap trusted: ```zsh brew tap shivammathur/php brew trust shivammathur/php ``` ### Install PHP > See [PHP Support](#php-support) for available formulae. - For example, to install `PHP 8.5`: ```zsh brew install shivammathur/php/[email protected] ``` - After installing you have to link it: ```zsh brew link --overwrite --force shivammathur/php/[email protected] ``` - Restart the terminal and test your PHP version: ```zsh php -v ``` ### Upgrade your PHP version You can upgrade your PHP version to the latest patch release. For example, to upgrade `PHP 8.5`: ```zsh brew upgrade shivammathur/php/[email protected] ``` ### Switch between PHP versions - If you have multiple PHP versions installed, you can switch between them easily. For example, to switch to `PHP 8.5`: ```zsh brew link --overwrite --force shivammathur/php/[email protected] ``` - If you get a warning like below, then do as recommended: ```zsh Warning: Already linked: To relink: brew unlink && brew link ``` ```zsh brew unlink [email protected] brew link --overwrite --force shivammathur/php/[email protected] ``` ### Restart your webserver If you are using `Apache` or `Nginx` with `php-fpm`, restart your webserver after any change in your PHP. - For Apache (`httpd`): ```zsh brew services restart httpd ``` - For Nginx: ```zsh brew services restart nginx ``` ## Debugging - Make sure you ran `brew update` before installing PHP. - Run `brew doctor` and fix the warnings it reports. - Make sure homebrew has correct permissions. ```zsh sudo chown -R "$(id -un)":"$(id -gn)" $(brew --prefix) ``` - If PHP is not working after a macOS update. Reinstall PHP along with its dependencies. For example to reinstall `PHP 8.5` and its dependencies: ```zsh brew reinstall $(brew deps shivammathur/php/[email protected]) shivammathur/php/[email protected] ``` - Check if your issue is a Homebrew's [common issue](https://docs.brew.sh/Common-Issues). - If you are still facing an issue, please create a discussion thread [here](https://github.com/shivammathur/homebrew-php/discussions). ## License The code in this project is licensed under the [MIT license](http://choosealicense.com/licenses/mit/). Please see the [license file](LICENSE) for more information. This project has some [dependencies](#dependencies), and their license can be found [here](LICENSE_HOMEBREW). ## Contributions Contributions are welcome! Please see [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/homebrew-php contribution guide") before you start. If you face any issues while using this tap or want to suggest a feature/improvement, create an discussion thread [here](https://github.com/shivammathur/homebrew-php/discussions "shivammathur/php discussions"). ## Sponsors In addition to GitHub Actions, we use [MacStadium](https://www.macstadium.com/opensource/members) for our CI infrastructure. This project is generously supported by many other users and organisations via [GitHub Sponsors](https://github.com/sponsors/shivammathur). ## Related Projects - [shivammathur/homebrew-extensions](https://github.com/shivammathur/homebrew-extensions "Tap for PHP extensions") - [shivammathur/setup-php](https://github.com/shivammathur/setup-php "Setup PHP in GitHub Actions") ## Dependencies - [Homebrew/brew](https://github.com/Homebrew/brew "Homebrew GitHub Repo") - [Homebrew/homebrew-core](https://github.com/Homebrew/homebrew-core "Homebrew core tap") - [Homebrew/actions](https://github.com/Homebrew/actions "Homebrew GitHub Actions")

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rubyarm64homebrewhomebrew-phphomebrew-tap

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言