Skip to content
Advertisement

Install mailparse on linux centos7

Hi I’m trying to install mailparse for my php7.4.21 on my linux centos7 server but the documentation is not great and I’m no sysadin.

https://www.php.net/manual/en/mailparse.installation.php states “In order to use these functions you must compile PHP with mailparse support by using the –enable-mailparse configure option”. This is not very helpful but so far I’ve had to do the following:

// 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

But looking at my phpinfo output I cannot see mailparse listed. What do I need to do next?

NOTE: I’m not sure I’ve actually “compiled PHP with mailparse” and I’m not sure how to apply “using the –enable-mailparse configure option”.

Thanks Abe

Advertisement

Answer

so I ended up on https://github.com/php-mime-mail-parser/php-mime-mail-parser/blob/master/README.md that talks about using sudo apt install php-cli php-mailparse for Ubuntu systems, which after a little more effort I found that yum install php-cli php-mailparse was the equivalent for centos (and then restarting apache). This worked.

yum install php-cli php-mailparse
systemctl restart httpd
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement