直接安装会提示找不到 openssl/ssl.h
文件
即便通过 Brew 安装了 OpenSSL brew install openssl
他自己找不到我们手动让他找到就行了呗…
当然 OpenSSL 一定是要安装的,命令就在上方…
然后 brew info openssl
可以看到:
For compilers to find openssl you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
For pkg-config to find openssl you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
另开一个终端窗口,然后依次执行:
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
pecl install swoole
结束。