Compile PHP with OpenSSL on Mac OSX error pits

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.