Installing PHP 5.6.14 with phpbrew and homebrew on OS X El Capitan.

Running:

phpbrew install 5.6.14 +default +mcrypt +fpm

…first results in the compilation error:

checking for pkg-config… /usr/local/bin/pkg-config
configure: error: Cannot find OpenSSL’s

…overcoming that leaves you with the link error:

Undefined symbols for architecture x86_64:
“_PKCS5_PBKDF2_HMAC”, referenced from:
_zif_openssl_pbkdf2 in openssl.o
“_TLSv1_1_client_method”, referenced from:
_php_select_crypto_method in xp_ssl.o
“_TLSv1_1_server_method”, referenced from:
_php_select_crypto_method in xp_ssl.o
“_TLSv1_2_client_method”, referenced from:
_php_select_crypto_method in xp_ssl.o
“_TLSv1_2_server_method”, referenced from:
_php_select_crypto_method in xp_ssl.o
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

To fix this, follow the phpbrew requirements installation. Set the following in your ~/.bash_profile and restart your terminal or run in your terminal:

export LDFLAGS=’/usr/local/opt/openssl/lib/libssl.dylib /usr/local/opt/openssl/lib/libcrypto.dylib’

Then run the install command with the openssl library version:

phpbrew install 5.6.14 +default +mcrypt +fpm — –with-openssl=/usr/local/opt/openssl

Switch to the new version:

phpbrew switch php-5.6.14

If this is a clean system pear will not be installed and calls to it will fail during the install process.

I run the following commands again to get everything building cleanly.

phpbrew install 5.6.14 +default +mcrypt +fpm — –with-openssl=/usr/local/opt/openssl
phpbrew switch php-5.6.14

This entry was posted in Computers. Bookmark the permalink.

Comments are closed.