I've installed OpenSSL 1.0.1j to /usr/local/ssl
and now I'm trying to compile PHP 5.5.19 using this version of OpenSSL. Here is my procedure to configure...
export CFLAGS="-arch x86_64"
export CXXFLAGS="-arch x86_64"
export LDFLAGS="-L/usr/local/ssl/lib"
export CPPFLAGS="-I/usr/local/ssl/include"
./configure \
--prefix=/usr/local/php5 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--with-config-file-path=/etc \
--with-zlib \
--with-zlib-dir=/usr \
--with-apxs2=/usr/sbin/apxs \
--with-openssl=/usr/local/ssl \
--without-iconv \
--enable-cli \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--with-mysql=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-gd \
--with-jpeg-dir=/usr/local/lib \
--with-png-dir=/usr/X11R6 \
--with-freetype-dir=/usr/X11R6 \
--with-xpm-dir=/usr/X11R6 \
--with-mcrypt \
--with-curl
The configure process appears to work fine, but when I run make, I get this:
Undefined symbols for architecture x86_64:
"_PKCS5_PBKDF2_HMAC", referenced from:
_zif_openssl_pbkdf2 in openssl.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: *** [libs/libphp5.bundle] Error 1
If I run the same configure options, but point openssl to the system version /usr
...
--with-openssl=/usr
...
Then make runs without a problem and php installs fine, but with an old version of OpenSSL. How can I get it to use my newer version of OpenSSL?
The Makefile has a line with EXTRA_LIBS
, something like:
EXTRA_LIBS = -lresolv -lmcrypt -lltdl -liconv-lm -lxml2 -lcurl -lssl -lcrypto
Remove all occurrences of -lssl
and -lcrypto
and add the full path to libssl.dylib
and libcrypto.dylib
EXTRA_LIBS = -lresolv -lmcrypt /usr/local/ssl/lib/libssl.dylib /usr/local/ssl/lib/libcrypto.dylib -lltdl -liconv-lm -lxml2 -lcurl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With