Brew update php56-xdebug requires changing zend_extension path in php.ini manually. Can it be scripted instead?

260 views Asked by At

I've installed php56-xdebug (along with php56, naturally) using homebrew and I've made the requisite addition to my php.ini

zend_extension="/usr/local/Cellar/php56-xdebug/2.3.2/xdebug.so"

Today I did a brew update && upgrade which updated my php56-xdebug to version 2.3.3 This, of course, changed the directory listing of the xdebug.so file to /usr/local/Cellar/php56-xdebug/2.3.3/xdebug.so

I'd love to find a way to update that automatically whenever it changes after a brew update/upgrade. Alas, I'm not knowledgeable enough in bash to know how to make this happen. Any thoughts?

2

There are 2 answers

0
Ja͢ck On BEST ANSWER

You could simply always use the symbolic links that Homebrew maintains for you inside /usr/local/opt:

zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
1
Rambo Ramon On

Homebrew always creates a symlink to the most recent version in /usr/local/bin or in your case, since it is a lib, in /usr/local/lib. Just use this path in your php.ini and it should be fine.