Git Product home page Git Product logo

homebrew-php's Introduction

Homebrew Tap for PHP

brew tap shivammathur/php

Build status LICENSE PHP Versions Supported macOS architectures supported macOS architectures supported

PHP Support

PHP Version Formula
PHP 5.6 [email protected]
PHP 7.0 [email protected]
PHP 7.1 [email protected]
PHP 7.2 [email protected]
PHP 7.3 [email protected]
PHP 7.4 [email protected]
PHP 8.0 php or [email protected]
PHP 8.1.0-dev [email protected]

OS Support

Operating System Architecture
macOS Catalina x86_64
macOS Big Sur x86_64, arm64

Usage

Prerequisites

  • Install Xcode Command Line Utilities
xcode-select --install
  • 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 7.4:
brew install shivammathur/php/[email protected]
  • After installing your have to link it:
brew link --overwrite --force [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 7.4:

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 7.4:

brew link --overwrite --force [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 [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 7.4 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.

Related Projects

Dependencies

homebrew-php's People

Contributors

brewtestbot avatar davidjpella avatar shivammathur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.