• Stars
    star
    2,443
  • Rank 18,821 (Top 0.4 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🍺 Homebrew tap for PHP 5.6 to 8.4. PHP 8.4 is built nightly.

Homebrew Tap for PHP

brew tap shivammathur/php

Build status LICENSE PHP Versions Supported

Linux architectures supported macOS architectures supported macOS architectures supported

PHP Support

PHP Version Formula Debug version
PHP 5.6 [email protected] [email protected]
PHP 7.0 [email protected] [email protected]
PHP 7.1 [email protected] [email protected]
PHP 7.2 [email protected] [email protected]
PHP 7.3 [email protected] [email protected]
PHP 7.4 [email protected] [email protected]
PHP 8.0 [email protected] [email protected]
PHP 8.1 [email protected] [email protected]
PHP 8.2 php or [email protected] php-debug or [email protected]
PHP 8.3.0-dev [email protected] [email protected]
PHP 8.4.0-dev [email protected] [email protected]

Debug versions

For each PHP version, there is an extra formula with debug symbols enabled. This version can be used when building or debugging PHP extensions and are not recommended for production usage.

OS Support

Operating System Architecture
Linux x86_64
macOS Big Sur x86_64, arm64
macOS Monterey x86_64, arm64
macOS Ventura x86_64, arm64

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/master/install.sh)"
  • If previously installed, update homebrew and the formulae:
brew update
  • If you have packages from old homebrew/php tap, refer to this guide for removing them.

Add this tap

Fetch the formulae in this tap:

brew tap shivammathur/php

Install PHP

See PHP Support for available formulae.

  • For example, to install PHP 8.1:
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.1:

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.1:

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 update before installing PHP.

  • Run brew doctor and 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.1 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 and Scaleway for our CI infrastructure.

Mac Stadium Mac Stadium Β Β Β Β Β Β Β Β Β  Scaleway Scaleway

This project is generously supported by many other users and organisations via GitHub Sponsors.

Sponsor shivammathur

Related Projects

Dependencies

More Repositories

1

setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
TypeScript
2,863
star
2

homebrew-extensions

🍻 Homebrew tap for PHP extensions
Ruby
630
star
3

countrycity

🌎 Geodata API - Get countries, and cities to plug in drop-downs.
PHP
102
star
4

php-builder

🐘 Build PHP 5.6 and newer
Shell
65
star
5

IPpy

πŸš€ Ping IP addresses and domains in parallel to find the accessible and inaccessible ones.
Python
57
star
6

cache-extensions

πŸ“¦ Cache PHP extensions in GitHub Actions
Shell
47
star
7

php-builder-windows

Build PHP 8.0 and above nightly snaps for Windows.
PowerShell
46
star
8

php5-ubuntu

Scripts to install the end-of-life PHP versions on Ubuntu 22.04, 20.04 and 18.04 amd64
Shell
25
star
9

TwitterScraper

Twitter Scraper - Scrape tweets for a user or a #hashtag.
Python
13
star
10

node-docker

Docker images with Node.js and PHP for CI
Shell
10
star
11

php-src-backports

Security backports for EOL versions of PHP.
Roff
9
star
12

icu-intl

Compiled versions of icu4c and intl php extension
Shell
7
star
13

php-extensions-windows

Build PHP extensions for windows
PowerShell
7
star
14

ghsvg

GitHub Sponsors SVG
TypeScript
7
star
15

codementor-mentees

Shivam Mathur's Codementor Mentees
JavaScript
6
star
16

php-ubuntu

Cached packages to install PHP on Ubuntu in GitHub Actions
Shell
6
star
17

composer-cache

Cache composer phars for setup-php.
Shell
6
star
18

test-setup-php

Testing Setup PHP GitHub Action
6
star
19

spc

setup-php-cli (spc) is a command line utility to run setup-php.
Shell
3
star
20

php5-darwin

Install PHP 5 versions on darwin
Shell
3
star
21

flask-chat-app

Chat app using flask and SocketIO in python.
JavaScript
3
star
22

php-darwin

Shell
3
star
23

shivammathur

2
star
24

.github

Default config for my GitHub projects.
2
star
25

init.lua

My nvim config
Lua
1
star
26

pacman

Classic pacman game built in python using pygame
Python
1
star
27

homebrew-openssl-deprecated

Formula for [email protected]
Ruby
1
star
28

homebrew-phalcon

Please use shivammathur/extensions tap instead.
Ruby
1
star
29

Computer-Networks-OMNeT-Lab

Assignments of my computer networks lab
C++
1
star