hyperf3.1 使用 swoole 报错 SwooleCoroutineHttpClientException·ERROR: you must configure with --enable-openssl
to support ssl connection when compiling Swoole
原因容器安装的swoole时并没有开启openssl
重新拉取 swoole 并安装,然后重启容器
${SWOOLE_VERSION} 为 swoole 版本,例:v5.1.1
容器运行
1: apk add autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake libaio-dev openssl-dev curl-dev
2: cd /tmp
&& curl -SL "https://github.com/swoole/swoole-src/archive/${SWOOLE_VERSION}.tar.gz" -o swoole.tar.gz
&& ls -alh
&& cd /tmp
&& mkdir -p swoole
&& tar -xf swoole.tar.gz -C swoole --strip-components=1
&& (
cd swoole
&& phpize
&& ./configure --enable-openssl --enable-swoole-curl
&& make -s -j$(nproc) && make install
)
&& docker-php-ext-enable swoole
&& rm -rf /tmp/swoole
3: 重启容器