Install and configure the following services
NOTE: If you have existing PHP installations via Homebrew, you need to first cleanup your setup with our Upgrading Homebrew cleanup guide before continuing with this section.
Remember only PHP 7.3 through 8.x are officially supported by Homebrew, but these also have to be built which is pretty slow.
PHP 8.0 has just been released and you are able to install it, but it might take some time for compatible PHP modules are fully available.
brew install php@7.3
brew install php@7.4
The versions of PHP installed by Homebrew will be in the directory /usr/local/etc/php
.
To install an PHP extension for a specific version with PECL.
Replace
<PHP_VERSION>
by your version[7.3|7.4|<MAJOR.MINOR>]
Replace
<PHP_EXTENSION>
by your desired extension
$(brew --prefix php@<PHP_VERSION>)/bin/pecl install <PHP_EXTENSION>
Follow instruction here: Service Configuration - PHP