如何在OS X上使用OpenSSL 1.0.1编译PHP 5.5.19

 刘胜良昭桂家贤 发布于 2022-12-09 20:49

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

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时,我得到了这个:

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

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

然后运行没有问题和PHP安装很好,但使用旧版本的OpenSSL.如何才能使用我的新版OpenSSL?

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有