在dockerfile安装代码里 配置了curl
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories \
&& apk add --update --no-cache \
php7 \
php7-json \
php7-ctype \
php7-exif \
php7-pdo \
php7-pdo_mysql \
php7-fpm \
apache2 \
php7-apache2 \
curl\
&& rm -f /var/cache/apk/*
然后在php.ini 里也开启了 extension=curl
但是使用 phpinfo 还是提示没安装成功
cURLSterling Hughes
代码部署里也没提示错误,还是不行
[2022-03-02 11:18:04] Step 2/7 : RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories && apk add --update --no-cache php7 php7-json php7-ctype php7-exif php7-pdo php7-pdo_mysql php7-fpm apache2 php7-apache2 curl && rm -f /var/cache/apk/*
[2022-03-02 11:18:04] ---> Running in 673c00e149fb
[2022-03-02 11:18:04] fetch https://mirrors.tencent.com/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
[2022-03-02 11:18:04] fetch https://mirrors.tencent.com/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
[2022-03-02 11:18:04] (1/31) Installing libuuid (2.37.4-r0)
[2022-03-02 11:18:04] (2/31) Installing apr (1.7.0-r0)
[2022-03-02 11:18:05] (3/31) Installing expat (2.2.10-r5)
[2022-03-02 11:18:05] (4/31) Installing apr-util (1.6.1-r7)
[2022-03-02 11:18:05] (5/31) Installing pcre (8.44-r0)
[2022-03-02 11:18:05] (6/31) Installing apache2 (2.4.52-r0)
[2022-03-02 11:18:05] Executing apache2-2.4.52-r0.pre-install
[2022-03-02 11:18:06] (7/31) Installing ca-certificates (20211220-r0)
[2022-03-02 11:18:06] (8/31) Installing brotli-libs (1.0.9-r3)
[2022-03-02 11:18:06] (9/31) Installing nghttp2-libs (1.42.0-r1)
[2022-03-02 11:18:06] (10/31) Installing libcurl (7.79.1-r0)
[2022-03-02 11:18:06] (11/31) Installing curl (7.79.1-r0)
[2022-03-02 11:18:06] (12/31) Installing php7-common (7.4.26-r0)
[2022-03-02 11:18:07] (13/31) Installing argon2-libs (20190702-r1)
[2022-03-02 11:18:07] (14/31) Installing ncurses-terminfo-base (6.2_p20210109-r0)
[2022-03-02 11:18:08] (15/31) Installing ncurses-libs (6.2_p20210109-r0)
[2022-03-02 11:18:08] (16/31) Installing libedit (20191231.3.1-r1)
[2022-03-02 11:18:08] (17/31) Installing pcre2 (10.36-r0)
[2022-03-02 11:18:08] (18/31) Installing xz-libs (5.2.5-r0)
[2022-03-02 11:18:09] (19/31) Installing libxml2 (2.9.12-r0)
[2022-03-02 11:18:09] (20/31) Installing php7 (7.4.26-r0)
[2022-03-02 11:18:10] (21/31) Installing php7-apache2 (7.4.26-r0)
[2022-03-02 11:18:11] (22/31) Installing php7-ctype (7.4.26-r0)
wx0476f7dc589926ae prod-9g723ognc40137fa rid=1nPFUrE6q1bSEl thinkphp-apache-1syi ptid=49802 thinkphp-apache-1syi-044
你好,还需要安装 php7-curl 这个依赖。
[2022-03-02 11:40:59] Step 2/7 : RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tencent.com/g' /etc/apk/repositories && apk add --update --no-cache php7 php7-json php7-ctype php7-exif php7-pdo php7-pdo_mysql php7-fpm apache2 php7-apache2 php7-curl && rm -f /var/cache/apk/*
[2022-03-02 11:40:59] ---> Running in 8c95c63d82c5
[2022-03-02 11:40:59] fetch https://mirrors.tencent.com/alpine/v3.13/main/x86_64/APKINDEX.tar.gz
[2022-03-02 11:40:59] fetch https://mirrors.tencent.com/alpine/v3.13/community/x86_64/APKINDEX.tar.gz
[2022-03-02 11:40:59] (1/31) Installing libuuid (2.37.4-r0)
[2022-03-02 11:41:02] (2/31) Installing apr (1.7.0-r0)
[2022-03-02 11:41:02] (3/31) Installing expat (2.2.10-r5)
[2022-03-02 11:41:02] (4/31) Installing apr-util (1.6.1-r7)
[2022-03-02 11:41:02] (5/31) Installing pcre (8.44-r0)
[2022-03-02 11:41:02] (6/31) Installing apache2 (2.4.52-r0)
[2022-03-02 11:41:03] Executing apache2-2.4.52-r0.pre-install
[2022-03-02 11:41:03] (7/31) Installing php7-common (7.4.26-r0)
[2022-03-02 11:41:03] (8/31) Installing argon2-libs (20190702-r1)
[2022-03-02 11:41:03] (9/31) Installing ncurses-terminfo-base (6.2_p20210109-r0)
[2022-03-02 11:41:03] (10/31) Installing ncurses-libs (6.2_p20210109-r0)
[2022-03-02 11:41:03] (11/31) Installing libedit (20191231.3.1-r1)
[2022-03-02 11:41:03] (12/31) Installing pcre2 (10.36-r0)
[2022-03-02 11:41:03] (13/31) Installing xz-libs (5.2.5-r0)
[2022-03-02 11:41:03] (14/31) Installing libxml2 (2.9.12-r0)
[2022-03-02 11:41:03] (15/31) Installing php7 (7.4.26-r0)
[2022-03-02 11:41:03] (16/31) Installing php7-apache2 (7.4.26-r0)
[2022-03-02 11:41:04] (17/31) Installing php7-ctype (7.4.26-r0)
[2022-03-02 11:41:04] (18/31) Installing ca-certificates (20211220-r0)
[2022-03-02 11:41:04] (19/31) Installing brotli-libs (1.0.9-r3)
[2022-03-02 11:41:04] (20/31) Installing nghttp2-libs (1.42.0-r1)
[2022-03-02 11:41:05] (21/31) Installing libcurl (7.79.1-r0)
[2022-03-02 11:41:07] (22/31) Installing php7-curl (7.4.26-r0)
wx0476f7dc589926ae prod-9g723ognc40137fa rid=1nPFr4BPkH1cCB thinkphp-apache-1syi ptid=49814 thinkphp-apache-1syi-045
使用了 php7-curl 也还是不行
&& apk add --update --no-cache \
php7 \
php7-json \
php7-ctype \
php7-exif \
php7-pdo \
php7-pdo_mysql \
php7-fpm \
apache2 \
php7-apache2 \
php7-curl \
&& rm -f /var/cache/apk/*