base on :beer: Homebrew tap for PHP 5.6 to 8.5. PHP 8.5 is built nightly. <p align="center">
<a href="https://github.com/shivammathur/homebrew-php" target="_blank">
<img src="https://repository-images.githubusercontent.com/229187949/f140f880-4c25-11eb-8105-aefec9dc7c66" alt="Homebrew Tap for PHP" width="560">
</a>
</p>
<h1 align="center">brew tap shivammathur/php</h1>
<p align="center">
<a href="https://github.com/shivammathur/homebrew-php" title="Homebrew tap to install PHP: Builds">
<img alt="Build status" src="https://github.com/shivammathur/homebrew-php/workflows/Update%20and%20Build%20Formulae/badge.svg">
</a>
<a href="https://github.com/shivammathur/homebrew-php" title="Homebrew tap to install PHP: Tests">
<img alt="Test status" src="https://github.com/shivammathur/homebrew-php/actions/workflows/test.yml/badge.svg">
</a>
<a href="https://github.com/shivammathur/homebrew-php/blob/master/LICENSE" title="license">
<img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555">
</a>
<a href="https://github.com/shivammathur/homebrew-php/tree/master/Formula" title="Formulae for PHP versions">
<img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.6%20to%208.5-777bb3.svg?logo=php&logoColor=white&labelColor=555555">
</a>
</p>
<p align="center">
<a href="https://github.com/shivammathur/homebrew-php#os-support" title="Linux x86_64 supported">
<img alt="Linux architectures supported" src="https://img.shields.io/badge/Linux-x86__64%20-f6ab01?logo=linux&logoColor=555555&labelColor=ffffff">
</a>
<a href="https://github.com/shivammathur/homebrew-php#os-support" title="Apple Intel x86_64 supported">
<img alt="macOS architectures supported" src="https://img.shields.io/badge/macOS-Intel%20x86__64%20-007DC3?logo=apple&logoColor=555555&labelColor=ffffff">
</a>
<a href="https://github.com/shivammathur/homebrew-php#os-support" title="Apple M1 arm64 supported">
<img alt="macOS architectures supported" src="https://img.shields.io/badge/macOS-Apple%20arm64%20-c0476d?logo=apple&logoColor=555555&labelColor=ffffff">
</a>
</p>
## 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 | `php` or `
[email protected]` | `php-debug` or `
[email protected]` | `php-zts` or `
[email protected]` | `php-debug-zts` or `
[email protected]` |
| PHP 8.5.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`|
|macOS Ventura|`x86_64`, `arm64`|
|macOS Sonoma|`x86_64`, `arm64`|
|macOS Sequoia|`x86_64`, `arm64`|
## 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/master/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:
```zsh
brew tap shivammathur/php
```
### Install PHP
> See [PHP Support](#php-support) for available formulae.
- For example, to install `PHP 8.4`:
```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.4`:
```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.4`:
```zsh
brew link --overwrite --force shivammathur/php/
[email protected]
```
- If you get a warning like below, then do as recommended:
```zsh
Warning: Already linked: <Cellar Path>
To relink:
brew unlink <formula> && brew link <formula>
```
```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.4` 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.
<a href="https://www.macstadium.com/opensource/members#gh-light-mode-only">
<img src="https://setup-php.com/sponsors/macstadium.png" alt="Mac Stadium" width="200px">
</a>
<a href="https://www.macstadium.com/opensource/members#gh-dark-mode-only">
<img src="https://setup-php.com/sponsors/macstadium-white.png" alt="Mac Stadium" width="200px">
</a>
This project is generously supported by many other users and organisations via [GitHub Sponsors](https://github.com/sponsors/shivammathur).
<a href="https://github.com/sponsors/shivammathur"><img src="https://setup-php.com/sponsors.svg?" alt="Sponsor shivammathur"></a>
## 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")
", Assign "at most 3 tags" to the expected json: {"id":"1071","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"