If you are trying to upgrade brew / homebrew’s PHP54 package by josegonzalez – especially if you have
pdo_oci.so you might be getting an error like this:
The actual text of the message is something like:
$ brew upgrade Updated Homebrew from 5b3410b6 to 44c284ff. ==> Upgrading 2 outdated packages, with result: php54 5.4.22, php54-mcrypt 5.4.22 ==> Upgrading php54 ==> Downloading http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror Already downloaded: /Library/Caches/Homebrew/php54-5.4.22 Warning: Backing up all known pear.conf and .pearrc files Warning: If you have a pre-existing pear install outside of homebrew-php, or you are using a non-standard pear.conf location, installation may fail. ==> ./configure --prefix=/usr/local/Cellar/php54/5.4.22 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/5.4 --with-config-file-path=/usr/local/etc/php/5 ==> make rc = ldap_sasl_interactive_bind_s(ld->link, binddn, ctx->mech, NULL, NULL, LDAP_SASL_QUIET, _php_sasl_interact, ctx); ^ 11 errors generated. make: *** [ext/ldap/ldap.lo] Error 1 make: *** Waiting for unfinished jobs.... READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting If reporting this issue please do so at (not mxcl/homebrew): https://github.com/josegonzalez/homebrew-php/issues ==> Upgrading php54-mcrypt Warning: Could not link php54. Unlinking...
Why does this happen?
In my case it was because I installed
oracle instaclient and was using that alongside homebrew. It has library files referenced in
/usr/local/include and they don’t play nice when you upgrade PHP / php54 with homebrew.
How do I fix it?
Open terminal and change to
Type in something like
ls -al | grep ldap to be presented with something like this:
lrwxr-xr-x 1 user group 52B Nov 19 21:37 ldap.h -> /usr/local/instantclient/18.104.22.168/sdk/include/ldap.h
Copy and paste that – make sure you write down the path of where that
symlink is pointing.
Now you can do
rm ldap.h to remove the symlink.
Next upgrade php54 with
brew upgrade or
brew upgrade php54 and when that has completed you can change back to that directory again and then type:
ln -s /usr/local/instantclient/22.214.171.124/sdk/include/ldap.h
You will need to replace the path you copied and pasted because most likely it will not be the same as mine.