PHP Version | Formula |
---|---|
PHP 8.0.30 | [email protected] |
PHP 8.2.0 | [email protected] |
PHP 8.2.1 | [email protected] |
PHP 8.2.2 | [email protected] |
PHP 8.2.3 | [email protected] |
PHP 8.2.4 | [email protected] |
PHP 8.2.5 | [email protected] |
PHP 8.2.6 | [email protected] |
PHP 8.2.7 | [email protected] |
PHP 8.2.8 | [email protected] |
PHP 8.2.9 | [email protected] |
PHP 8.2.10 | [email protected] |
PHP 8.2.11 | [email protected] |
PHP 8.2.12 | [email protected] |
PHP 8.2.13 | [email protected] |
PHP 8.2.14 | [email protected] |
PHP 8.2.15 | [email protected] |
PHP 8.2.16 | [email protected] |
- 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 remove them.
Fetch the formulae in this tap:
brew tap artemeon/php
See PHP Support for available formulae.
- For example, to install
PHP 8.2.12
:
HOMEBREW_PHP_VERSION="8.2.12" brew install artemeon/php/[email protected]
- After installing you have to link it:
brew link --overwrite --force artemeon/php/[email protected]
- If you need to have [email protected] first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"' >> ~/.zshrc
- Restart the terminal or run
source ~/.zshrc
and test your PHP version:
php -v