下载基础镜像
docker pull hyperf/hyperf:8.1-alpine-v3.15-base
安装依赖
apk add --no-cache libpng-dev freetype-dev libjpeg-turbo-dev libwebp-dev libxpm-dev \
zlib-dev \
libzip-dev \
autoconf gcc g++ make dpkg-dev automake \
libmcrypt-dev openssl-dev \
Pecl编译安装
cd /bin/
wget http://pear.php.net/go-pear.phar -O go-pear.php
php go-pear.php
尝试使用pecl安装rdkafka
apk add --no-cache librdkafka-dev
pecl install rdkafka
报以下错误:
configure: error: Cannot find php-config. Please use --with-php-config=PATH
ERROR: `/tmp/pear/install/rdkafka/configure' failed
但是不要紧rdkafka的安装包已经下载下来了,路径在/tmp/pear/install/
编译安装
apk add make
pecl install rdkafka
报错 少依赖 apk search pcre apk add pcre2-dev apk add pcre2 终于安装成功
|