Posts Learn Components Snippets Categories Tags Tools new About
/

How to easily switch PHP version and update configuration on macOS Monterey

Learn how to easily switch PHP version and update its configuration on macOS Monterey using PHP Monitor

Created on Jan 02, 2022

329 views

In this short snippet, we'll be showing you how to update your PHP configuration and easily switch between different PHP version on macOS Monterey by using PHP Monitor.
PHP Monitor in action

A little bit of PHP Monitor: "PHP Monitor (or phpmon) is a lightweight macOS utility app that runs on your Mac and displays the active PHP version in your status bar. It's tightly integrated with Laravel Valet, so you need to have it set up before you can use this."

PHP Monitor Installation


To install PHP Monitor you can make use of Homebrew and below are the 2 commands that you need to run on your terminal.
brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon

How to Switch PHP Version?


To switch to the PHP version you can simply open the PHP Monitor menu and then press the respective PHP version. In the case of the screenshot below, we have versions 7.4, 8.0, and 8.1. Otherwise, you can change it using Command + 1 or Command + 2 or Command + 3 but make sure the menu is opened.
PHP Monitor Versions List

How to Restart or Stop PHP Services?


To restart or stop the PHP services it's available under the "manage services" and just like switching PHP versions, you can make use of the shortcuts Command + D, Command + P, Command N, or top stop all services Shift + Command + S.
Restart or Stop PHP

How to Edit PHP Config?


Lastly, to edit the PHP Configuration you can locate the config files and then use your preferred text editor and then save it. Do make sure to restart the PHP service so that it's applied.
PHP Configuration Location

By now you should be able to configure, switch and easily manage your PHP on your macOS easily. If this snippet is useful do make sure to share it with your friends and cheers, happy trying!

Links

If you like our tutorial, do make sure to support us by being our Patreon or buy us some coffee ☕️

)