Follow the simple steps below to upgrade to PHP version on you OSX to 7.2

Step # 01: Make sure the brew is updated

brew update

brew upgrade

Step # 02: Unlink the Previously installed PHP version

brew unlink php71

If you have another older version of PHP, write that instead.

Finally – Install PHP 7.2

brew install php72

Wait for the installation to finish, you’re now running on PHP 7.2. You may run php -v to check the current PHP version on your machine.

 

 

 

 

 

 

 

 

 

 


First, make sure you’re on the version of PHP for which you want Xdebug installed. It needs to be installed separately for each major version (7.0 vs 7.1 vs 7.2). You can check your version using php -v.

Then, run pecl install xdebug.

Once it’s finished installing, you’ll see a message like this:

Installing '/usr/local/Cellar/php/7.2.8/pecl/20170718/xdebug.so'

Then go to your php.ini (which you can find by running php --ini, and add these two lines to it:

zend_extension="/usr/local/Cellar/php/7.2.8/pecl/20170718/xdebug.so"
xdebug.remote_enable=on

Obviously, change the path to whatever was printed by the pecl xdebug installation.