If you happen to see two different versions of PHP whenever you run:
php -vin the console and visitphpinfo()in the browser
Then this usually means the version of PHP that your web server is using is different than the version of PHP your command-line is using.

Specifically, this means you likely have more than one installation, and the web server is using one version, and the terminal is using a different version (in addition to using a CLI version of the interpreter).
Of course, if you’re seeing the browser and the terminal show different versions of PHP then something is wrong. You want them to be the same, but depending on how your system is configured, then you may need to update your environmental variables.
I was recently having issues with this with various installations of PHP installed via Homebrew and with my local installation of Valet.

This is what I did to fix it.


