Use Homebrew/core instead of Homebrew/php
brew install [email protected] --with-pear
brew install [email protected] --with-pear
brew install [email protected] --with-pear
brew install [email protected] --with-pear
Also, you may have the need to tweak configuration settings of PHP to your needs. A common thing to change is the memory setting, or the date.timezone configuration. The php.ini files for each version of PHP are located in the following directories:
/usr/local/etc/php/5.6/php.ini
/usr/local/etc/php/7.0/php.ini
/usr/local/etc/php/7.1/php.ini
/usr/local/etc/php/7.2/php.ini
To switch to PHP 5.6
brew unlink [email protected] && brew link --force --overwrite [email protected]
To check which php.ini is in used
php --ini
or
php -i | grep 'Configuration File'
Configuration File (php.ini) Path => /etc
Loaded Configuration File => /etc/php.ini