Note: this article assumes you have php72 installed
Install php72 development files
yum install php72-devel
Change to temporary folder
cd /tmp/
Download mailparse source code
you can also download specific version from http://pecl.php.net/package/mailparse
wget https://github.com/php/pecl-mail-mailparse/archive/master.zip
Unzip source code
unzip master.zip
Change to mailparser folder
cd pecl-mail-mailparse-master
Compile regular TS version
phpize
./configure
make
Copy mailparser module to php modules folder
cp modules/mailparse.so /usr/lib64/php/7.2/modules/mailparse.so
Add to ini
echo "extension=mailparse.so" > /etc/php.d/mailparse.ini
Clean install
make clean
Now compile ZTS (Zend Thread Safety) version
zts-phpize
./configure --with-php-config=/usr/bin/zts-php-config
make
Add to php modules
cp modules/mailparse.so /usr/lib64/php-zts/7.2/modules/mailparse.so
Add to ini file
echo "extension=mailparse.so" > /etc/php-zts.d/25-mailparse.ini
Restart apache
service httpd restart
Verify that module is loaded
For cli php:
php-7.2 -m |grep mailparse