Posts Learn Components new Snippets new Categories Tags About

How to install PHP 8 on macOS Big Sur using Homebrew

Learn how to install PHP version 8 on macOS Big Sur easily using Homebrew package manager.

10 months ago

10 mins read


In this post, we'll be looking at how to install PHP 8 on macOS Big Sur using Homebrew. By right the steps will also work for the previous macOS versions like Catalina and Mojave.

Step 1: Install Homebrew

The first step is to install Homebrew and this is a tool (package manager for macOS) that will allow us to install easily PHP and basically any other package/tools.
/bin/bash -c "$(curl -fsSL"

Step 2: Install PHP

To install PHP we can use the command below. The first command will automatically install the latest version of PHP which is at the current moment of writing this post version 8.
brew install php
If other versions may be preferred we can specify the PHP version and the code will look like the following.
brew install [email protected]

Step 3: The php.ini Config

The default PHP configuration should be sufficient to get started but if there are any other configurations, we can change them through the php.ini located on this path. Do note the PHP version number which in this case is version 8.

Step 4: Check if PHP is running

To check if PHP is already running we can make use of the brew services command. First, we can list the services that we have installed.
brew services list
If PHP is not started we can then run the command below to start the service in the background.
brew services start [email protected]

Step 5: Checking PHP Version

Lastly to check the PHP version do run:
php -v
By now you will have PHP running on the background process and every time you logged in to the system it will start by default. Thanks for reading and have a good try.

Alternative Tags


If you like our tutorial, do make sure to support us with some coffee. We need the juice to write the content during the night 🤙🏻


PostSrc Code Snippets

Learn new snippets today, level up your Laravel, Alpine JS, Vue JS, Tailwind CSS skills and more.

Learn New Snippets

PostSrc Code Components

Collection of Tailwind CSS components for everyone to use. Browse all of the components that are right for your project.

View Components