Upgrade to PHP 8 with Homebrew on Mac

#Upgrading with Homebrew

brew update

#Normal upgrade

brew upgrade php

#Upgrade with shivammathur/homebrew-php

brew tap shivammathur/php
brew install shivammathur/php/php@8.0
brew link --overwrite --force php@8.0

#Next steps

php -v
sudo nginx -s reloadsudo apachectl restart
# index.php, accessible to your web serverphpinfo();


composer global update
valet install


pecl install imagick
pecl install redis
pecl install xdebug
pecl list# Installed packages, channel pecl.php.net:
# =========================================
# Package Version State
# imagick 3.4.4 stable
# redis 5.1.1 stable
# xdebug 2.8.0 stable
pecl search pdf# Retrieving data...0%
# ..
# Matched packages, channel pecl.php.net:
# =======================================
# Package Stable/(Latest) Local
# pdflib 4.1.2 (stable) Creating PDF on the fly with the PDFlib library
sudo nginx -s reloadsudo apachectl restart
valet restart
php -i | grep redisvar_dump(extension_loaded('redis'));
Configuration File (php.ini) Path: /usr/local/etc/php/7.4
Loaded Configuration File: /usr/local/etc/php/7.4/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.4/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.4/conf.d/ext-opcache.ini,
pecl uninstall imagick
pecl install imagick

#Last step



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store