在linux centos7上安装mailparse

7rfyedvj  于 2022-11-07  发布在  Linux
关注(0)|答案(1)|浏览(280)

嗨,我正在尝试在我的linux centos7服务器上安装我的php7.4.21的mailparse,但是文档不是很好,我也不是系统管理员。
https://www.php.net/manual/en/mailparse.installation.php声明“为了使用这些函数,您必须使用--enable-mailparse configure选项编译支持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配置选项”。
谢谢阿贝

odopli94

odopli941#

所以我最终在https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/master/README.md上讨论了在Ubuntu系统中使用sudo apt install php-cli php-mailparse,经过一点努力,我发现yum install php-cli php-mailparse是Centos的等价物(然后重新启动apache)。

yum install php-cli php-mailparse
systemctl restart httpd

相关问题