Home / Snippets / How to easily switch PHP version and update configuration on macOS Monterey
How to easily switch PHP version and update configuration on macOS Monterey cover

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

985

2 years ago

0 comments

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

notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

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

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this