您当前的位置: 首页 >  ssl

彭世瑜

暂无认证

  • 4浏览

    0关注

    2791博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

报错:No package ‘openssl‘ found

彭世瑜 发布时间:2022-06-26 14:16:34 ,浏览量:4

MacOS编译安装PHP8.0的时候报错如下:

No package 'openssl' found

检查是否安装

openssl version

# 或者
brew info openssl

# 未安装就安装
brew install openssl

如果已经安装还是报错,将PKG_CONFIG_PATH添加到环境变量中

# ~/.bash_profile

# pkgconfig
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig

# openssl
export OPENSSL_LIBS="-L/usr/local/Cellar/openssl@1.1/1.1.1p/lib"
export OPENSSL_CFLAGS="-I/usr/local/Cellar/openssl@1.1/1.1.1p/include"

注意路径中的版本号可以不太一样

注册到pkgconfig中

# 查看 openssl 是否在 pkgconfig 中
pkg-config --list-all | grep openssl

# 如果不在pkgconfig,可以新建软链
cd /usr/local/Cellar/openssl@1.1/1.1.1p/lib/pkgconfig
ln -s `pwd`/openssl.pc /usr/local/lib/pkgconfig

参考 macOS 解决 No package ‘openssl’ found 错误

关注
打赏
1665367115
查看更多评论
立即登录/注册

微信扫码登录

0.0560s