To check the version of PHP in the terminal, type the following command:
or can see what versions of PHP are installed with
brew list | grep php
Maybe it’s worth cleaning up some of the old packages from brew. It’s up to you.
Make sure brew is up to date:
brew update brew upgrade
Let’s finally install 7.2 version of PHP
brew install email@example.com
If you need to have this version of PHP first in your
PATH run the following command:
echo 'export PATH="/firstname.lastname@example.org/bin:$PATH"' >> ~/.bash_profile echo 'export PATH="/email@example.com/sbin:$PATH"' >> ~/.bash_profile source ~/.bash_profile
And the result?
Where is a php.ini file?
Your .ini file is located in
/usr/local/etc/php/7.2/php.ini. To check just type
How to install extensions?
PHP extensions have been removed and now should be installed from
pecl install xdebug