Bez Hermoso, Software Engineer @ Square

Last night I decided to make the switch from using purely Homebrew to manage my local machine’s PHP version to using phpbrew. However the switch was without any issues.

I needed to install PHP version 5.6.14 with mcrypt:

> phpbrew install 5.6.14 +default+mcrypt

However the build process keeps failing. Inspecting the build log gives me the following errors at different stages of troubleshooting:

configure: error: Cannot find OpenSSL's <evp.h>
configure: error: Please reinstall the BZip2 distribution
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [sapi/cli/php] Error 1


What I ended up having to do was re-install XCode Command-Line Tools and install a few libraries via Homebrew (because apparently, OS X does not ship them, or ship older versions):

> xcode-select --install
> brew install openssl libxml2 mcrypt
> brew link openssl libxml2 --force

And that’s it! The build completed, and now I have PHP 5.6.14 available whenever I want it.

If you are encountering these errors, I hope this helps you. Or if you haven’t attempted it yet but are planning to build PHP with phpbrew, I hope this will save you the trouble.

Happy coding!

comments powered by Disqus