docker php7.2-fpm can't install imap module

前端 未结 3 1166
误落风尘
误落风尘 2021-01-12 15:03

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

Here is what my php dockerfile looks like.

FROM php:7.2-fpm

RUN apt-get upda         


        
相关标签:
3条回答
  • 2021-01-12 15:14

    Actual in 2020 for PHP 7.4 and PHP 8 on Linux Alpine

    RUN apk add imap-dev krb5-dev
    RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
            && docker-php-ext-install imap \
            && docker-php-ext-enable imap
    

    Here is a PHP 7 cli working answer, posted on the official library here

    FROM php:7-cli-alpine
    
    RUN set -xe && \
        apk add --update --no-cache \
            imap-dev \
            openssl-dev \
            krb5-dev && \
        (docker-php-ext-configure imap --with-kerberos --with-imap-ssl) && \
        (docker-php-ext-install imap > /dev/null) && \
        php -m | grep -F 'imap'
    
    0 讨论(0)
  • 2021-01-12 15:37

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

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

    You can see an example of Dockerfile in one of my project

    0 讨论(0)
  • 2021-01-12 15:37

    Solved it by using

    RUN apt update && apt install -y libc-client-dev libkrb5-dev && rm -r /var/lib/apt/
    
    RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && docker-php-ext-install imap
    

    Found at https://stackoverflow.com/a/52314180/2311074

    0 讨论(0)
提交回复
热议问题