php 配置:错误:utf8_mime2text() 有新签名,但缺少 U8T_CANONICAL

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13436356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 05:26:08  来源:igfitidea点击:

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing

phpmacos

提问by dvlden

Today I am trying to upgrade php on MacOS Mountain Lion. I followed MacTuts+tutorial and on the step where I execute that long command:

今天我正在尝试在 MacOS Mountain Lion 上升级 php。我遵循了MacTuts+教程并在执行该长命令的步骤中:

./configure  \
--prefix=/usr  \
--mandir=/usr/share/man  \
--infodir=/usr/share/info  \
--sysconfdir=/private/etc  \
--with-apxs2=/usr/sbin/apxs  \
--enable-cli  \
--with-config-file-path=/etc  \
--with-libxml-dir=/usr  \
--with-openssl=/usr  \
--with-kerberos=/usr  \
--with-zlib=/usr  \
--enable-bcmath  \
--with-bz2=/usr  \
--enable-calendar  \
--with-curl=/usr  \
--enable-dba  \
--enable-exif  \
--enable-ftp  \
--with-gd  \
--enable-gd-native-ttf  \
--with-icu-dir=/usr  \
--with-iodbc=/usr  \
--with-ldap=/usr  \
--with-ldap-sasl=/usr  \
--with-libedit=/usr  \
--enable-mbstring  \
--enable-mbregex  \
--with-mysql=mysqlnd  \
--with-mysqli=mysqlnd  \
--without-pear  \
--with-pdo-mysql=mysqlnd  \
--with-mysql-sock=/var/mysql/mysql.sock  \
--with-readline=/usr  \
--enable-shmop  \
--with-snmp=/usr  \
--enable-soap  \
--enable-sockets  \
--enable-sysvmsg  \
--enable-sysvsem  \
--enable-sysvshm  \
--with-tidy  \
--enable-wddx  \
--with-xmlrpc  \
--with-iconv-dir=/usr  \
--with-xsl=/usr  \
--enable-zip  \
--with-imap=/usr/local/imap-2007 \
--with-kerberos \
--with-imap-ssl \
--enable-intl \
--with-pcre-regex  \
--with-pgsql=/usr  \
--with-pdo-pgsql=/usr \
--with-freetype-dir=/usr/X11 \
--with-jpeg-dir=/usr  \
--with-png-dir=/usr/X11

I get the error at the end of process.

我在过程结束时收到错误消息。

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

配置:错误:utf8_mime2text() 有新签名,但缺少 U8T_CANONICAL。这不应该发生。检查 config.log 以获取更多信息。

Any solution? Thanks in advance.

有什么解决办法吗?提前致谢。

回答by Aistis

For those who have the same error on docker:

对于那些在 docker 上有同样错误的人:

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

回答by kervin

If you have the 'libc-client-devel' RPM or other package in your OS repository then install it.

如果您的操作系统存储库中有“libc-client-devel”RPM 或其他软件包,请安装它。

This will provide the c-client library and header files which PHP needs for IMAP support.

这将提供 PHP 支持 IMAP 所需的 c 客户端库和头文件。

回答by Fredy

the error can be fixed by removing the IMAP support, removing these lines

可以通过删除 IMAP 支持来修复错误,删除这些行

--with-imap=/usr/local/imap-2007
--with-imap-ssl

回答by Robert.C

Old threads never die ...

旧线程永不消亡...

I'm on OSX Yosemite 10.10.5, and have installed my own php, currently 5.6.1, and want to upgrade to 5.6.13 - came across that same error just following imap.

我在 OSX Yosemite 10.10.5 上,并且已经安装了我自己的 php,目前是 5.6.1,并且想要升级到 5.6.13 - 在 imap 之后遇到了同样的错误。

Saw this thread, and ran brew install map-uwthen ran configurebased on my existing phpinfooutput.

看到这个线程,brew install map-uw然后configure根据我现有的phpinfo输出运行。

./configure \
--prefix=/usr/local/php5 \
--with-apxs2=/usr/sbin/apxs \
--with-config-file-scan-dir=/usr/local/php5/php.d \
--with-openssl=/usr \
--with-zlib=/usr \
--with-zlib-dir=/usr \
--with-gd \
--with-ldap \
--with-xmlrpc \
--enable-exif \
--enable-soap \
--enable-wddx \
--enable-ftp \
--enable-sockets \
--with-bz2=/usr \
--enable-zip \
--enable-shmop \
--enable-sysvsem \
--enable-sysvshm \
--enable-sysvmsg \
--enable-mbstring \
--enable-bcmath \
--enable-calendar \
--with-mhash \
--enable-fpm \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--enable-pcntl \
--enable-dtrace \
--enable-opcache \
--disable-phpdbg \
--with-icu-dir=/usr/local/php5 \
--with-mssql=shared,/usr/local/php5 \
--with-pdo-dblib=shared,/usr/local/php5 \
--with-libxml-dir=shared,/usr/local/php5 \
--with-xsl=shared,/usr/local/php5 \
--with-imap=shared,/usr/local/Cellar/imap-uw/2007f \
--with-kerberos=/usr \
--with-imap-ssl=/usr \
--with-gettext=/usr/local/php5 \
--with-curl=shared,/usr/local/php5 \
--with-png-dir=/usr/local/php5 \
--with-jpeg-dir=/usr/local/php5 \
--enable-gd-native-ttf \
--with-freetype-dir=/usr/local/php5 \
--with-pgsql=shared,/usr/local/php5 \
--with-pdo-pgsql=shared,/usr/local/php5 \
--with-mcrypt=shared,/usr/local/php5 \
--with-tidy=/usr/local/php5 \
--with-gmp=shared,/usr/local/php5 \
--with-readline=shared,/usr/local/php5

Then make. And it seems to be working fine.

然后make。它似乎工作正常。

回答by Mat

I've Installed the following package and it works :
uw-imap-devel

Run this command on CentOS 7.x :
yum -y install uw-imap-devel

我已经安装了以下软件包并且可以正常工作:
uw-imap-devel

在 CentOS 7.x 上运行此命令:
yum -y install uw-imap-devel

回答by Octopus

This exact same problem came up for me on Fedora when trying to compile PHP 5.5.0.

在尝试编译 PHP 5.5.0 时,我在 Fedora 上遇到了完全相同的问题。

The problem is related to the '--with-imap'configuration parameter.

问题与'--with-imap'配置参数有关。

In order to solve this problem I compiled my own version of imap from the latest source (currently imap-2007f) and to do that I had to install some prerequisites. On fedora I did this...

为了解决这个问题,我从最新的源代码(当前是 imap-2007f)编译了我自己的 imap 版本,为此我必须安装一些先决条件。在软呢帽上我做了这个......

yum install openssl openssl-devel pam-devel
wget ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
tar zxvf imap-2007f.tar.gz

Then I had to make a soft link so the compiler could find the libraries. In my case I did the following:

然后我必须建立一个软链接,以便编译器可以找到这些库。就我而言,我执行了以下操作:

mkdir /usr/local/ssl
ln -s /usr/include /usr/local/ssl/include

and then compile:

然后编译:

cd imap-2007f
make lnp SSLTYPE=unix EXTRACFLAGS=-fPIC

Then I was able to compile PHP by adding the imap source path to the config param like so:

然后我能够通过将 imap 源路径添加到配置参数来编译 PHP,如下所示:

/path/to/php/src> ./configure ...other_params... '--with-imap=/path/to/imap-2007f' '--with-imap-ssl' 
make
make install

回答by t4ncr3d3

Install imap before installing php.

在安装 php 之前安装 imap。

brew install imap-uw

brew 安装 imap-uw

then

然后

brew install php55 --with-fpm --with-imap --without-apache --with-debug

brew install php55 --with-fpm --with-imap --without-apache --with-debug

The --with-imap option should then run fine.

--with-imap 选项应该可以正常运行。

回答by Rony Mesquita

Docker and PHP with Apache (php:apache default image) can works with:

Docker 和 PHP with Apache(php:apache 默认图像)可以与:

RUN apt-get update && apt-get install libc-client-dev libkrb5-dev
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl

Other dependencies can be needed, depending on the installation.

可能需要其他依赖项,具体取决于安装。