最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - Error on PHP 8.4-fpm IMAP package install with Dockerfile - Stack Overflow

programmeradmin3浏览0评论

In my Dockerfile for php8.4-fpm i am installing IMAP package with the following commands:

FROM php:8.4-fpm
[...]
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
    docker-php-ext-install imap

But got an error:

process "/bin/sh -c docker-php-ext-configure imap --with-kerberos --with-imap-ssl" did not complete successfully: exit code: 1

How to solve it?

In my Dockerfile for php8.4-fpm i am installing IMAP package with the following commands:

FROM php:8.4-fpm
[...]
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
    docker-php-ext-install imap

But got an error:

process "/bin/sh -c docker-php-ext-configure imap --with-kerberos --with-imap-ssl" did not complete successfully: exit code: 1

How to solve it?

Share Improve this question asked Feb 17 at 6:31 IgorIgor 1,1573 gold badges21 silver badges31 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

OK. Solved. I found that since PHP 8.4 the IMAP extension is no longer part of PHP Core, and has moved to PECL.

So the solution to install IMAP package for PHP since 8.4 version from Dockerfile is:

RUN pecl install imap && \
    docker-php-ext-enable imap

Also if you do not use docker but just a native SSH commands on a Debian/Ubuntu. You should use these commands:

sudo apt-get install libc-client-dev libkrb5-dev

# may be on some systems you need this
sudo ln -s /usr/lib/x86_64-linux-gnu/libkrb5.so /usr/lib/
sudo ln -s /usr/lib/x86_64-linux-gnu/libc-client.so /usr/lib/

pecl install imap
echo "extension=imap.so" | sudo tee -a /etc/php/8.4/cli/php.ini
echo "extension=imap.so" | sudo tee -a /etc/php/8.4/fpm/php.ini
sudo systemctl restart php8.4-fpm

# check imap is installed
php -m | grep imap

Hope that helps!

发布评论

评论列表(0)

  1. 暂无评论