Install Mailparse extension (or others) Tutorial

Hello guys.
The other days, i needed to install and enable mailparse pecl extension, as it is a required extension for Blesta billing software.
After some tries and help from cyberpanel support people.. i have it installed and running :

This is the "how to do" :

1 - i want to install it under PHP 7.0X

2 - step by step from console as root:
# yum install re2c
# yum install lsphp70-devel make gcc glibc-devel zlib-devel
# /usr/local/lsws/lsphp70/bin/pecl install mailparse
# chmod 755 /usr/local/lsws/lsphp70/lib64/php/modules/*

3 - IMPORTANT : we need to create a "mailparse.ini" to load as module in php, but the "mbstring" extension must to be loaded BEFORE the "mailparse" extension.
In /usr/local/lsws/lsphp70/etc/php.d/ you can see all the extensions to be loaded by php, normally with a number like 00- or 20- etc. That number indicates the PRIORITY of loading.
In my case the mbstring is :
SO, to create the mailparse ini there, i need to create it with 30- (to load it AFTER mbstring), THEN....

# echo "" > /usr/local/lsws/lsphp70/etc/php.d/30-mailparse.ini

and finally :

# systemctl restart lsws

You have the mailparse extension installed under php70X and runnning perfect

You can do this almost with all the extension you need. Always investigate about conflicts, and the correct loading priority dependencies (this was my BIG mistake and it takes too long to working propely just for it)

I hope it helps :)


  • hi, while following up this, i get:


    Build process completed successfully
    Installing '/usr/local/lsws/lsphp70/lib64/php/modules/'
    install ok: channel://
    configuration option "php_ini" is not set to php.ini location
    You should add "" to php.ini


    do i need to do something else to install it? or it's already installed?
Sign In or Register to comment.
Support CyberPanel CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion