docker php7.2-fpm无法安装imap模块 [英] docker php7.2-fpm can't install imap module

查看:41
本文介绍了docker php7.2-fpm无法安装imap模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在尝试使imap与我的docker-compose配合使用时遇到问题.

I'm having problems trying to get imap working with my docker-compose.

这是我的php dockerfile的样子.

Here is what my php dockerfile looks like.

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

但是我不断收到错误消息

But I keep getting the error

Call to undefined function imap_open()

我一直在尝试许多不同的方法来使imap工作,但似乎没有任何工作对我有用.我需要继续使用php7.2,因此降级到php5对我来说不是一个选择.

I've been trying a lot of different ways of getting the imap to work, but nothing seems to be working for me. I need to keep using php7.2 so downgrading to php5 is not an option for me.

我的理想结果是保留fpm的当前php版本,并找到一个不错的解决方案以使imap与当前的dockerfile一起使用.

My ideal outcome is to keep the current php version of fpm and find a nice solution to get imap working with the current dockerfile.

添加

Docker-php-ext-install imap 

在dockerfile内部似乎不起作用,并导致以下错误:

inside the dockerfile does not seem to work and result with the following error:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.

推荐答案

要在Docker中将imap模块与PHP结合使用,您必须像这样配置扩展名

To use imap module with PHP in Docker you must configure extension like this

docker-php-ext-configure imap --with-kerberos --with-imap-ssl

您可以在我的项目之一中看到Dockerfile的示例

这篇关于docker php7.2-fpm无法安装imap模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆