报错:No package ‘openssl‘ found

简介: 报错:No package ‘openssl‘ found

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 错误

相关文章
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
装R包(package)error:(as ‘lib’ is unspecified)installation of package had non-zero exit status]
No package ‘glib-2.0‘ found/No package ‘gobject-2.0‘ found
No package ‘glib-2.0‘ found/No package ‘gobject-2.0‘ found
199 0
No package ‘libusb‘ found
No package ‘libusb‘ found
137 0
No package ‘gobject-introspection-1.0‘ found
No package ‘gobject-introspection-1.0‘ found
256 0
No package ‘polkit-gobject-1‘ found
No package ‘polkit-gobject-1‘ found
106 0
No package ‘libmatekbd‘ found
No package ‘libmatekbd‘ found
64 0
No package ‘dconf‘ found
No package ‘dconf‘ found
108 0
No package ‘vte-2.91‘ found
No package ‘vte-2.91‘ found
75 0
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
No package ‘libpeas-1.0‘ found/No package ‘libpeas-gtk-1.0‘
50 0
No package ‘gtk+-3.0‘ found
No package ‘gtk+-3.0‘ found
171 0