由于MacOS M1Max版本中系统的文件结构修改、openssl的c库位置不在linux的功能文件库中。

报错信息:Warning: file_get_contents(): you must configure with --enable-openssl to support ssl connection when compiling Swoole in

如果是通过homebrew安装的openssl那么文件夹的位置是/opt/homebrew/Cellar/

指定openssl-dir的位置: --with-openssl-dir=/opt/homebrew/Cellar/openssl@3/3.0.0_1

安装参数

./configure --enable-http2 --enable-thread-context --enable-http2  --enable-mysqlnd --enable-openssl --with-openssl-dir=/opt/homebrew/Cellar/openssl@3/3.0.0_1 --enable-sockets --enable-swoole-json --enable-swoole-curl

pecl 方式安装

pecl install --configureoptions '--with-openssl-dir="/opt/homebrew/opt/openssl@3" enable-sockets="yes" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="yes" enable-swoole-curl="yes" enable-cares="yes"' http://localhost/swoole-5.0.1.tgz
Last modification:January 13, 2023
如果觉得我的文章对你有用,请随意赞赏