Categories
DevOps

Install Mailparse extension on PHP 7.0 + Apache + Vagrant (Ubuntu)

1. SSH into your server (Vagrant, Whatever)

vagrant ssh

# or

ssh [email protected]

2. Follow the following instruction:

cd /tmp

apt-get install php7.0-dev

pecl download mailparse

tar xvzf mailparse-3.0.2.tgz

cd mailparse-3.0.2

phpize

./configure

sed -i \
  's/^\(#error .* the mbstring extension!\)/\/\/\1/' \
  mailparse.c

make

make install
echo "extension=mailparse.so" > \
  /etc/php/7.0/fpm/conf.d/30-mailparse.ini

service php7.0-fpm reload
echo "extension=mailparse.so" > \ /etc/php/7.0/mods-available/mailparse.ini 
ln -s /etc/php/7.0/mods-available/mailparse.ini /etc/php/7.0/cli/conf.d/30-mailparse.ini 
ln -s /etc/php/7.0/mods-available/mailparse.ini /etc/php/7.0/cli/conf.d/30-mailparse.ini

Source: https://stackoverflow.com/questions/35793216/installing-mailparse-php7-mbstring-error

Although I ended up adding manually (last step) maybe this can be a future reference for myself or any other developer.

Leave a Reply

Your email address will not be published. Required fields are marked *