Setting mailparse php7 mbstring error

I am currently working to ensure that our project is under php7.

When I try to compile the mailparse extension or use pecl to install it, I get this error:

#error The mailparse extension requires the mbstring extension!

I installed php7.0-mbstring and tried to install the mbstring extension with the mailparse source code. I also tried using my old C skills and trying to enable libraries myself without success.

Do any of you have an idea how I can solve my problem? (without editing the code, as I saw on some forums)

thanks

+5
source share
1 answer

You should be able to download the mailparse source, comment out the HAVE_MBSTRING test in mailparse.c (near line 34), and create it normally.

Here is what I did in Ubuntu 16.04 (suppose 'sudo' if necessary):

 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 

Then you need to enable the mailparse.so module in your PHP configuration.

For Ubuntu 16.04 and PHP-FPM you should use:

 echo "extension=mailparse.so" > \ /etc/php/7.0/fpm/conf.d/30-mailparse.ini service php7.0-fpm reload 
+25
source

Source: https://habr.com/ru/post/1244420/


All Articles