polewneat.blogg.se

Php for mac os
Php for mac os












php for mac os

You can combine brew unlink and brew link to swap between any installed version. Once installed, you can switch between PHP versions by ‘linking’ and ‘unlinking’ in brew: # Switch from 7.4 to 5.6īrew link -force Switching from PHP 7.4 to 5.6 You can also use the built-in web server that comes with Mac, the Apache web server, to execute PHP programs. You can interact with PHP programs via the Terminal application (Applications -> Utilities -> Terminal). Now, we can install all the available PHP versions: brew install The macOS / Mac OS X operating system comes pre-installed with the libraries needed to run PHP programs. To install PHP 5.6, 7.0 & 7.1 we’ll need to ‘tap’ a repository for deprecated packages: brew tap exolnet/homebrew-deprecated Install Multiple PHP VersionsĪs of writing, only PHP 7.2, 7.3 and 7.4 are maintained and supported by Homebrew. You can also run brew doctor to check everything is good to go. usr/bin/ruby -e "$(curl -fsSL )"Ĭheck that brew has installed: $ brew -version You’ll need both Xcode Command Line Tools and Homebrew installed.ġ.1 Install XCode Command Line Tools xcode-select -install Using several versions of PHP on macOS via homebrew 1. The instructions below are for use with macOS 10.15 Catalina, and allow installation of PHP 5.6, 7.0, 7.1, 7.2, 7.3 & 7.4. I recently needed to switch between PHP versions on my macOS environment to work on a legacy project.Īs usual, I’d forgotten how to do this, so I’ve decided to publish the steps for my own and other’s reference.














Php for mac os