mac 编译安装php7.4 后 开启openssl扩展错误记录
cd 到php源码目录下ext下的openssl然后phpize
检测
./configure --with-php-config=/usr/local/php7/bin/php-config --with-openssl
错误1
Package requirements (openssl >= 1.0.1) were not met:
No package 'openssl' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
解决1
首先确认是否已经安装了 openssl version
如果未安装,brew install openssl
。
OpenSSL 1.1.1q 5 Jul 2022
1、vi ~/.bash_profile 追加PKG_CONFIG_PATH 路径和声明openssl lib/include 的路径
-
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
-
export PKG_CONFIG_PATH
-
export OPENSSL_LIBS="-L/usr/local/Cellar/openssl@1.1/1.1.1q/lib"
-
export OPENSSL_CFLAGS="-I/usr/local/Cellar/openssl@1.1/1.1.1q/include"
-
export PATH=/usr/local/opt/openssl@1.1/bin:$PATH
-
export LDFLAGS=-L/usr/local/opt/openssl@1.1/lib
-
export CPPFLAGS=-I/usr/local/opt/openssl@1.1/include
2、注册 openssl 到 pkgconfig 中
-
# 查看 openssl 是否在 pkgconfig 中
-
pkg-config --list-all | grep openssl
-
-
# 如果 pkgconfig 中没有 openssl 包 则手动建立 或者 尝试 brew unlink/link 重建
-
cd /usr/local/Cellar/openssl@1.1/1.1.1d/lib/pkgconfig
-
ln -s `pwd`/openssl.pc /usr/local/lib/pkgconfig
错误2
108 warnings and 1 error generated.
make: *** [ext/openssl/openssl.lo] Error 1
这个错误主要是 openssl 版本 php版本不兼容,brew install openssl 默认安装的是最新openssl@3版本,发生以上错误
由于Debian Stretch默认使用OpenSSL 1.1.0。PHP 5.6 与更高版本的 OpenSSL 不兼容。这是一个 PHP 问题,但不确定它们是否会修复。
解决2
找到问题所在就好解决了,brew install openssl@1.1 安装openssl低版本就可以了。php7.4 一下都不与openssl@3兼容,php8 未知。
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /boutique/detail/tanhfiahga
-
photoshop保存的图片太大微信发不了怎么办
PHP中文网 06-15 -
Android 11 保存文件到外部存储,并分享文件
Luke 10-12 -
word里面弄一个表格后上面的标题会跑到下面怎么办
PHP中文网 06-20 -
《学习通》视频自动暂停处理方法
HelloWorld317 07-05 -
微信公众号没有声音提示怎么办
PHP中文网 03-31 -
photoshop扩展功能面板显示灰色怎么办
PHP中文网 06-14 -
excel下划线不显示怎么办
PHP中文网 06-23 -
怎样阻止微信小程序自动打开
PHP中文网 06-13 -
excel打印预览压线压字怎么办
PHP中文网 06-22 -
photoshop蒙版画笔没反应怎么办
PHP中文网 06-24