Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
how to instal mailparse on php7
REQUIREMENTS:
- php-pear (install automatically php7.0-xml and php-xml)
sudo apt-get install php-pear
-php7.0-mbstring
sudo apt-get install php7.0-mbstring
-php7.0-dev
sudo apt-get install php7.0-dev
INSTALLATION:
1- cd /tmp/xxxxxx (e.g: cd /tmp/pear/download)
2- wget http://pecl.php.net/get/mailparse-3.0.1.tgz
3- tar -xzvf mailparse-3.0.0.1.tgz
4- cd mailparse-3.0.1
5- build
6- ./configure
7- make
If make generates an error
- sudo mkdir /tmp/pear/download/mailparse-3.0.1/
- cp /usr/share/php7.0-mbstring/mbstring/mbstring.ini /tmp/pear/download/mailparse-3.0.1/ext
- sudo nano mailparse.c
- comment the lines 33, 34 and 35
/*#if !HAVE-MBSTRING
#error
#endif*/
-save and run again the commande make
8-sudo make install
CONFIGURATION:
- add extension =mailparse.so to php.ini under cli and fpm (in dynamics extensions)
sudo nano /etc/php/7.0/cli/php.ini
sudo nano /etc/php/7.0/fpm/php.ini
-make mailparse.ini file in mods-available directory
cd /etc/php/7.0/mods-available
sudo nano mailparse.ini
insert those lines
; configuration for php mailparse module
; priority=20
extension=mailparse.so
-make a link to the mailparse.ini
cd /etc/php/7.0/fpm/conf.d
sudo ln -s /etc/php/7.0/mods-available/mailparse.ini 20-mailparse.ini
@motin

This comment has been minimized.

Copy link

@motin motin commented Aug 24, 2017

Thanks :) Just so you know: php-mailparse is available in official debian since stretch: https://packages.debian.org/search?keywords=php-mailparse

@spkvn

This comment has been minimized.

Copy link

@spkvn spkvn commented Aug 30, 2017

You've saved my life.

@dusterio

This comment has been minimized.

Copy link

@dusterio dusterio commented Feb 12, 2018

Step 5 should be "phpize" instead of "build". At least in Ubuntu

@xavier-lc

This comment has been minimized.

Copy link

@xavier-lc xavier-lc commented Mar 29, 2018

It worked for me, many thanks! :)

@OnlyHardOfficial

This comment has been minimized.

Copy link

@OnlyHardOfficial OnlyHardOfficial commented Jun 15, 2018

Almost compile but when I press "sudo make install" this error <---SOLVED
https://gyazo.com/ea8a8ac26ae3cfeea3a43057ec894581 <---SOLVED
##########################################################

@dusterio have right its "phpize" not build

Man, I do not know how to say this, but I have only to say Thank you, Thanks to you I was able to solve a problem that from far away, I alone would not be able to achieve without your help, your tutorial!
Thank you so much!

@manojbharti

This comment has been minimized.

Copy link

@manojbharti manojbharti commented Oct 21, 2019

Not worked for me

@jotapepinheiro

This comment has been minimized.

Copy link

@jotapepinheiro jotapepinheiro commented Nov 9, 2019

apt-get install php-mailparse
phpenmod mailparse
Reload php, nginx or apache

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment