The following error occurred when compiling PHP manually from the source code:
Default
1234567891011121314 |
Undefined symbols for architecture x86_64: "_pkcs5_pbkdf2_hmac", referenced from: _zif_openssl_pbkdf2 in OpenSSL. o "_tlsv1_1_client_method", referenced from: _php_openssl_setup_crypto in xp_ssl. o "_tlsv1_1_server_method", referenced from: _php_openssl_setup_crypto in xp_ssl. o "_tlsv1_2_client_method", referenced from: _php_openssl_setup_crypto in xp_ssl. o "_tlsv1_2_server_method", referenced from: _php_openssl_setup_crypto 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 /span> Make: * * * * [Libs/libphp5. Bundle] Error 1 |
Solutions
MakeFile inside found a line similar to the following:
Default
1 |
extra_libs = -lresolv -lmcrypt -lltdl -liconv-lm - Lxml2 -lcurl -lssl - lcrypto |
Remove all-lssl and-lcrypto and add libssl.dylib and libcrypto.dylib paths (if you have brew installed, then/usr/local/opt/openssl/lib/), rerun the Make command, Done
Attached to my revised MakeFile Extra_libs line:
Default
1 |
Extra_libs = -Lz -Lresolv -Lmcrypt -Lltdl -Lstdc++ -Liconv -Liconv -Lpng -Lz -Lcurl -Lz -Lm -Lxml2 -Lz -Licucore -Lm -Lcurl -Lxml2 -Lz -Licucore -Lm -licui18n -Licuuc -Licudata -Licuio -Lxml2 -Lz -Licucore -Lm -Lxml2 -Lz -Licucore -Lm -Lxml2 -Lz -Licucore -Lm -Lxml2 -Lz -Licucore -Lm /usr/ Local/opt/openssl< Span class= "Crayon-o" >/lib/libssldylib /usr/local/opt /openssl/lib/libcrypto. Dylib |
The Makefile have a line EXTRA_LIBS
with, something like:
EXTRA_LIBS = -lresolv -lmcrypt -lltdl -liconv-lm -lxml2 -lcurl -lssl -lcrypto
Remove all occurrences of and and add the full path to and -lssl
-lcrypto
libssl.dylib
libcrypto.dylib
(Brew links OpenSSL to/usr/local/o pt/openssl/lib/)
Extra_libs= -Lresolv-Lmcrypt/usr/Local/opt/OpenSSL/Lib/Libssl.Dylib/usr/Local/opt /OpenSSL/lib/libcrypto . dylib -Lltdl -liconv-lm -lxml2 -lcurl
Compile PHP with OpenSSL on Mac OSX error pits