【发布时间】:2021-01-25 17:13:04
【问题描述】:
我在尝试让 imap 与我的 docker-compose 一起工作时遇到问题。
这是我的 php dockerfile 的样子。
FROM php:7.2-fpm
RUN apt-get update && \
apt-get install -y \
curl \
libmcrypt-dev \
unzip \
git
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-
dir=/usr/local/bin --filename=composer
RUN composer --version
# Set timezone to UTC
RUN rm /etc/localtime
RUN ln -s /usr/share/zoneinfo/UTC /etc/localtime
RUN "date"
RUN apt-get -y install libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& rm -r /var/lib/apt/lists/*
RUN /usr/local/bin/docker-php-ext-install pdo pdo_mysql
ADD ./scripts/entry.sh /root/init.sh
WORKDIR /var/www/insight
但我不断收到错误
Call to undefined function imap_open()
我一直在尝试很多不同的方法来让 imap 工作,但似乎没有什么对我有用。我需要继续使用 php7.2,所以降级到 php5 对我来说不是一个选择。
我的理想结果是保留当前的 php 版本的 fpm 并找到一个很好的解决方案来让 imap 与当前的 dockerfile 一起工作。
添加
Docker-php-ext-install imap
dockerfile 内部似乎不起作用并导致以下错误:
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
【问题讨论】:
-
尝试将 imap-dev 添加到您的
apt-get install ...(来自github.com/docker-library/php/issues/244) -
@NigelRen 结果:E:无法定位包 imap-dev
-
作为替代方案,请尝试 libc-client-devel(来自 stackoverflow.com/questions/13436356/…)
-
@NigelRen 也无法找到该软件包,因为我的图像基于 ubuntu 我尝试了软件包 libc-client2007e-dev,为此我还尝试使用 libc-client-dev 和 libc -client-devel 但都导致无法找到包。
-
libc-client2007e-dev 存在于 Ubuntu 中,尝试登录您的容器,看看您是否可以手动执行此步骤。