Looking for new opportunities
I am always looking for a new opportunities to expand my knowledge and help others while doing so, there for if you are looking for someone to join your team or you have something you want some help with feel free to reach out via email.
Now that homebrew has fully deprecated the old PHP channel and merged everything within the code,
things have changed. Before you were able to install anything using a command like
brew install php- but
now it won't work anymore.
The new way is simple and easy (not), so follow me:
First, you will need to make sure the old taps or anything old you have (maybe just moves them to another directory).
Second, update and clean up your
brew installation, run those commands for example:
brew update && brew upgrade brew doctor
and fix any issue you see.
Install PHP via brew by running
brew install php which will install PHP 7.2 by default.
annoying part (for me), which I can't blame them for it nor I can say anything about, is installing
pecl , that's correct we are back to use
pecl install xdebug
After that running
php -v will complain about not finding
xdebug and that's because PHP load the extensions
from a directory while PECL installs them in a different one.
In my case PHP loads them from the following path
And PECL installs them at the following path
My simple solution was to symbolic xdebug file to the path that PHP load by running
cd /usr/local/Cellar/php/7.2.4_1/lib/php/20170718 ln -s /usr/local/Cellar/php/7.2.4_1/pecl/20170718/xdebug.so
So my advice for you is to read the log correctly, as this will help you a lot and spare you a lot of time. Also,
remember to run
php -m before installing anything.