shivammathur/homebrew-php
shivammathur/homebrew-php has 2,877 GitHub stars and 183 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-06 19:59 UTC. Last push 2026-11-01.
Homebrew tap for PHP 5.6 to 8.7. PHP 8.6 and 8.7 are built nightly :beer:
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalbrew tap shivammathur/php
PHP Support
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:
xcode-select --install
- On Linux, install cURL and Git:
# Using APT
sudo apt-get install -y curl git
# Using Yum
sudo yum install -y curl git
- Install Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/main/install.sh)"
- If previously installed, update homebrew and the formulae:
brew update
- If you have packages from old
homebrew/phptap, refer to this guide for removing them.
Add this tap
Fetch the formulae in this tap and mark the tap trusted:
brew tap shivammathur/php
brew trust shivammathur/php
Install PHP
See PHP Support for available formulae.
- For example, to install
PHP 8.5:
brew install shivammathur/php/[email protected]
- After installing you have to link it:
brew link --overwrite --force shivammathur/php/[email protected]
- Restart the terminal and test your PHP version:
php -v
Upgrade your PHP version
You can upgrade your PHP version to the latest patch release.
For example, to upgrade PHP 8.5:
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:
brew link --overwrite --force shivammathur/php/[email protected]
- If you get a warning like below, then do as recommended:
Warning: Already linked: <Cellar Path>
To relink:
brew unlink <formula> && brew link <formula>
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):
brew services restart httpd
- For Nginx:
brew services restart nginx
Debugging
Make sure you ran
brew updatebefore installing PHP.Run
brew doctorand fix the warnings it reports.Make sure homebrew has correct permissions.
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:
brew reinstall $(brew deps shivammathur/php/[email protected]) shivammathur/php/[email protected]
Check if your issue is a Homebrew's common issue.
If you are still facing an issue, please create a discussion thread here.
License
The code in this project is licensed under the MIT license. Please see the license file for more information.
This project has some dependencies, and their license can be found here.
Contributions
Contributions are welcome! Please see Contributor's 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.
Sponsors
In addition to GitHub Actions, we use MacStadium for our CI infrastructure.
This project is generously supported by many other users and organisations via GitHub Sponsors.
Related Projects
Dependencies
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,541 starspublic-apis/public-apis
A collective list of free APIs
496,818 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
438,945 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,094 stars