Site icon Fix I.T. Phill – Your Go-To Tech Guru

How to Install PHP 8.3 on macOS Using Homebrew

MacBook with terminal showing PHP 8.3 installation, surrounded by Homebrew icons and PHP logos.

Introduction: In this tutorial, we’ll walk through the steps to install PHP 8.3 on your macOS using Homebrew. This guide is particularly useful for developers who need to upgrade their PHP version for testing or development purposes.

Requirements:

Step 1: Update Homebrew First, ensure that your Homebrew is up-to-date. Open your terminal and run:

brew update

Step 2: Install PHP 8.3 You have two options to install PHP 8.3. You can either use the built-in PHP recipe or use the shivammathur/homebrew-php tap. The latter is recommended as it allows easy installation and switching between different PHP versions.

Step 3: Switching PHP Versions To switch between installed PHP versions, use the following command:

brew link --overwrite --force php@8.3

Step 4: Verify Installation After installation, verify that PHP 8.3 is correctly installed:

php -v

The output should show PHP 8.3.x.

Step 5: Restart Web Server Finally, restart your web server to apply the changes. This could be Nginx or Apache, depending on your setup:

Conclusion: You have successfully installed PHP 8.3 on your macOS using Homebrew. This setup is essential for developers who need to work with the latest PHP features or test their applications on different PHP versions.

Exit mobile version