如何在OS X上使用OpenSSL 1.0.1编译PHP 5.5.19 [英] How to compile PHP 5.5.19 with OpenSSL 1.0.1 on OS X

查看:129
本文介绍了如何在OS X上使用OpenSSL 1.0.1编译PHP 5.5.19的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将OpenSSL 1.0.1j安装到了/usr/local/ssl,现在我正尝试使用此版本的OpenSSL编译PHP 5.5.19.这是我的配置过程...

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

配置过程似乎工作正常,但是当我运行make时,我得到了:

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

如果我运行相同的配置选项,但是将openssl指向系统版本/usr

If I run the same configure options, but point openssl to the system version /usr

...
--with-openssl=/usr
...

然后make运行不会出现问题,并且php可以很好地安装,但使用的是旧版本的OpenSSL.如何使用新版本的OpenSSL?

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?

推荐答案

Makefile的一行带有EXTRA_LIBS,类似于:

The Makefile has a line with EXTRA_LIBS, something like:

EXTRA_LIBS = -lresolv -lmcrypt -lltdl -liconv-lm -lxml2 -lcurl  -lssl -lcrypto

删除所有出现的-lssl-lcrypto,并将完整路径添加到libssl.dyliblibcrypto.dylib

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

这篇关于如何在OS X上使用OpenSSL 1.0.1编译PHP 5.5.19的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆