【发布时间】:2022-01-24 10:40:32
【问题描述】:
您好,我正在尝试在我的 linux centos7 服务器上为我的 php7.4.21 安装 mailparse,但文档不是很好,而且我不是 sysadin。
https://www.php.net/manual/en/mailparse.installation.php 声明“为了使用这些函数,您必须使用 --enable-mailparse 配置选项编译带有 mailparse 支持的 PHP”。这不是很有帮助,但到目前为止,我必须执行以下操作:
// To install re2c:
> curl http://dl.fedoraproject.org/pub/epel/7/x86_64/Packages/r/re2c-0.14.3-2.el7.x86_64.rpm --output re2c-0.14.3-2.el7.x86_64.rpm
> rpm -Uvh re2c-0.14.3-2.el7.x86_64.rpm
// I then installed mailparse
> pecl install mailparse
// I then modified php.ini to add the following:
extension=mailparse
// I then restarted apache
> systemctl restart httpd
但是查看我的 phpinfo 输出,我看不到列出的 mailparse。 接下来我需要做什么?
注意:我不确定我是否真的“使用 mailparse 编译 PHP”,也不确定如何应用“使用 --enable-mailparse 配置选项”。
谢谢 安倍
【问题讨论】:
-
你还没有编译 PHP,你只是安装了一个扩展。
-
那么你如何编译 PHP [on centos]?
-
不要。你不想编译东西只是为了得到一个模块。首先,请查看
php -i | grep -C3 mailparse。此外,尝试为您的操作系统找到一个包,而不是 PECL,我很确定rpm允许在包描述中搜索字符串。