gpt4 book ai didi

php - 无法在Laradock中安装php7.2-ldap扩展

转载 作者:行者123 更新时间:2023-12-02 20:46:59 25 4
gpt4 key购买 nike

我正在尝试在Laradock中安装php7.2-ldap并且已经设置

WORKSPACE_INSTALL_LDAP=true


PHP_FPM_INSTALL_LDAP=true

然后尝试建立像
docker-compose build workspace

我收到此错误消息。日志的一部分
The following NEW packages will be installed:
php7.2-ldap
0 upgraded, 1 newly installed, 0 to remove and 28 not upgraded.
Need to get 23.1 kB of archives.
After this operation, 101 kB of additional disk space will be used.
Err:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 php7.2-ldap amd64 7.2.4-1+ubuntu16.04.1+deb.sury.org+1
404 Not Found
E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.2/php7.2-ldap_7.2.4-1+ubuntu16.04.1+deb.sury.org+1_amd64.deb 404 Not Found

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
ERROR: Service 'workspace' failed to build: The command '/bin/sh -c if [ ${INSTALL_LDAP} = true ]; then apt-get install -y libldap2-dev && apt-get install -y php${PHP_VERSION}-ldap ;fi' returned a non-zero code: 100

这是怎么回事,为什么我不能安装它?

最佳答案

我在回答我自己的问题。

这是通过添加来解决的

apt-get update -yqq && \

之前
apt-get install -y libldap2-dev && \

workspace/Dockerfilephp-fpm\Dockerfile中。

一个完整的块如下所示:

文件: workspace\Dockerfile
###########################################################################
# LDAP:
###########################################################################

ARG INSTALL_LDAP=false
ARG PHP_VERSION=${PHP_VERSION}

RUN if [ ${INSTALL_LDAP} = true ]; then \
apt-get update -yqq && \
apt-get install -y libldap2-dev && \
apt-get install -y php${PHP_VERSION}-ldap \
;fi

为什么会发生这种情况?
来自Github的报价 issue:

What appears to be happening here is that there are a few apt-get install commands for several packages are called while the local package repo is out of sync with the remote. In an interactive environment, this would be seen by the user and an appropriate apt-get update would be run. However, the Dockerfile does not contain any package repo update commands, as such the current layer has a different package repo list than the remote. This is in general the "problem" with dockers layers as they will be re-used if their command didn't change (something I, too, had to learn the hard way).



作者: Philipp Tempel

关于php - 无法在Laradock中安装php7.2-ldap扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51120563/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com