在官方PHP docker映像上安装IMAP扩展名时出错

问题描述:

如果在PHP docker映像中安装IMAP扩展,则可能会出现一些错误,例如:

If you're installing the IMAP extension in your PHP docker image, it's possible that you get some errors like:


configure:错误:utf8_mime2text()具有新的签名,但缺少
U8T_CANONICAL。这不应该发生。在config.log中查看
的其他信息。

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

,然后:


配置:错误:此c客户端库是使用Kerberos
支持构建的。

configure: error: This c-client library is built with Kerberos support.


要解决此错误:


configure:错误:utf8_mime2text()具有新签名,但是缺少
U8T_CANONICAL。这不应该发生。在config.log中查看
的其他信息。

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

您只需要运行下一个命令:

You just need to run the next command:

apt update && apt install -y libc-client-dev libkrb5-dev && rm -r /var/lib/apt/lists/*

所以,现在可能是一个新的出现错误:

So, now is probably that a new error appear:


配置:错误:此c客户端库内置Kerberos
支持。

configure: error: This c-client library is built with Kerberos support.

要解决此新错误,必须使用以下命令安装扩展:

To solve this new error, you must install the extension with the next command:

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