Hero Image

Mailparse php module ZTS and TS version on AMI 2018 linux

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

Other Related Posts:

Get back PHP7.4 on FreeBSD

Recently freebsd did drop (reason: eol) php7.4 support in FreeBSD and it is not available via packages or latest ports anymore. This guide will get back php7.4 from ports using help of git commit log. Last ports php7.4 related (update to php 7.4.33) commit was in git 27ac371f93d36f77f00b8da261e496...

Read more

17th Jan 2023