Phpmon
Lightweight, native Mac menu bar app that helps you manage multiple PHP installations, locate config files and more. Also interacts with Laravel Valet.
Install / Use
/learn @nicoverbruggen/PhpmonREADME
<p align="center"><img src="./docs/logo.svg" alt="PHP Monitor Logo" width="500px" /></p>Note If this software has been useful to you, I ask that you please star the repository, that way I know that the software is being used. Also, please consider sponsoring to support the project, as this is something I make in my free time. Thank you! ⭐️
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 <u>you need to have it set up if you want to use all of the functionality of the app</u> (consult the FAQ below with info about how to set up your environment).
<img src="./docs/marketing@2x.jpg" width="1033px" alt="phpmon screenshot (menu bar app)"/><small><i>Screenshot: Showing the key functionality of PHP Monitor. You can switch between PHP versions, manage PHP installations, install extensions, manage domains, and much more.</i></small>
It's super convenient to globally switch between different versions of PHP. This applies the selected version of PHP as the default on your system.
If you prefer, you can also pick a PHP version on a per-site basis (this uses Valet's site isolation feature) which is very helpful.
<img src="./docs/notification.png" width="370px" alt="phpmon screenshot (notification)"/>PHP Monitor also gives you quick access to various useful functionality (like accessing configuration files, restarting services, and more).
You can also add new domains as links, isolate sites, manage various services, and perform First Aid to fix all kinds of common PHP and Homebrew issues.
🖥 System requirements
PHP Monitor is a universal application that runs natively on Apple Silicon and Intel-based Macs.
- Your user account can administer your computer (required for some functionality, e.g. certificate generation)
- macOS 13.5 or later
- Homebrew is installed in the default location (
/usr/local/homebrewor/opt/homebrew) - Homebrew
phpformula is installed - Optional but recommended: Laravel Valet
For more information, please see SECURITY.md to find out which version of the app is currently supported.
🚀 How to install
Again, if you want to have access to all features of PHP Monitor, I recommend installing Laravel Valet first:
composer global require laravel/valet
valet install
valet trust
Currently, PHP Monitor is compatible with Laravel Valet v2 up to v4. Each of these versions of Valet support slightly different PHP versions, which is why legacy versions remain supported. Please note that some features are not available in older versions of Valet, like site isolation.
Manual installation (recommended, first time only)
Once that's done, you can download the latest release, unzip it and place it in /Applications.
Installation via Homebrew
Alternatively, if you prefer to install the app via Homebrew, you can also run the following:
brew tap nicoverbruggen/homebrew-cask
brew install --cask phpmon
(You may want to disable the built-in update check if you install PHP Monitor this way.)
⬆️ How to update
The recommended method of updating the app to the latest version is to use the built-in updater.
If you have a very slow internet connection, the updater may report that the download has timed out. In that case, you may wish to manually update by downloading the latest release and placing the app in /Applications.
(You may also use Homebrew to update PHP Monitor, but this will require you to approve the app every time an update is installed. If you use the built-in updater, this won't be necessary.)
⚡️ Launchers (Alfred, Raycast)
If you would like to integrate with your launcher of choice, you can also download an Alfred workflow or Raycast extension that works with PHP Monitor.
Keep in mind that third-party integrations are turned off by default, but you will be prompted to approve third-party integrations the very first time a third-party app attempts to connect with PHP Monitor.
You will only be prompted once to allow or disallow this, but you can always change your mind about this later, in Settings, by (un)checking the box next to "Allow third-party integrations".
(For more information about how this works and the potential security considerations, please consult the FAQ below.)
🔑 Is the app signed & notarized?
Yes, the app is signed and notarized, meaning all you have to do is approve its first launch (or whenever it updates).
👨💻 Why build this?
I wanted to be able to see at a glance which version of PHP was linked, and handle dealing with Laravel Valet in a simple app without having to deal with the terminal every time.
Initially, I had an Alfred workflow for this — but it has now been replaced with this utility, which also does a good job at displaying additional information at a glance, like the current PHP version, memory limits, and more.
🐘 Why not use Laravel Herd?
Disclaimer: The author is not affiliated with Laravel or the Laravel team, nor Beyond Code, who maintain Laravel Herd. PHP Monitor is an independent project.
If you don't need to customize your local PHP setup and just want an easy and ready-to-go environment to start coding, Laravel Herd is a great alternative to PHP Monitor, since it does not rely on Homebrew. The app also offers paid features that may be useful to you or your team.
Herd may not be for everyone, which is why other solutions to run PHP locally exist. PHP Monitor preceded Herd and will remain supported. I highly recommend that you try different tools, and use what you like best.
🤬 The app won't start?!
PHP Monitor performs some integrity checks to ensure a good experience when using the app. You'll get a message telling you that PHP Monitor won't work correctly in a variety of scenarios.
Follow instructions as specified in the alert in order to resolve any issues.
(If the app crashes at launch without showing you any of these messages, you might have a non-standard Homebrew and Valet setup. Those are not supported.)
🙋♂️ FAQ & Troubleshooting
If you are having issues, the first thing you should be doing is installing the latest version of PHP Monitor and Laravel Valet. This can resolve a variety of issues. To upgrade Valet, run
composer global update. Don't forget to runvalet installafter upgrading.
If you're still having issues, here's a few common questions & answers, as well as issues and solutions:
<details> <summary><strong>Which versions of PHP are supported?</strong></summary>All stable and supported PHP versions are also supported by PHP Monitor. However, depending on which version of Valet you have installed, which versions of PHP that are made available for switching purposes may differ.
Note If you have versions of PHP installed that can be detected by PHP Monitor but is not supported by the currently active version of Valet, you will be alerted by an item in the menu with an exclamation mark emoji. (⚠️)
Backports that are installable via PHP Monitor's PHP Version Manager functionality are subject to availability via this tap.
PHP extensions that are installable via PHP Monitor's PHP Extension Manager functionality are subject to availability via this tap.
For maximum compatibility with older PHP versions, you may wish to keep using Valet 2 or 3. For more information, please see SECURITY.md to find out which versions of PHP are supported with different versions of Valet.
</details> <details> <summary><strong>How do I install additional versions of PHP, including legacy versions?</strong></summary>Assuming you have installed the php formula, the latest stable version of PHP is installed. At the time of writing, this is PHP 8.4.
You can install other supported versions of PHP via PHP Monitor's PHP Version Manager. (You can manually install or upgrade PHP versions too, but this is not recommended.)
Please keep in mind that installing or updating PHP versions, even when done via PHP Monitor's PHP Version Manager, may cause other required formula dependencies (required software needed to keep those PHP versions functional) to be upgraded. It might not be very transparent when this happens, but this is likely the cause if installing a PHP version takes longer than expected: usually other dependencies are also being installed.
Additionally, upgrading one specific version of PHP may also cause other installed versions of PHP to also be updated in one go, if the dependencies for that one version also apply to the other (newer) version(s) of PHP. It's a bit tricky to manage PHP versions via Homebrew, and even PHP Monitor may encounter some difficulties.
If you encounter a strange scenario or a malfunction, please open an issue on the issue tracker and get in touch. I'd like to keep enhancing this process to make it as foolproof as possible.
</details> <details> <summary><strong>I want PHP Monitor to start up when I bootNote: Using PHP Monitor when managing PHP versions may cause temporary alias conflicts while the core tap alias and the tap's alias refer to a different version of PHP, but this is generally speaking a minor inconvenience, since this normally only applies when a new PHP version releases.
