安装mailparse php7 mbstring错误 [英] Installing mailparse php7 mbstring error
问题描述
我目前正在将我们的项目放在php7下.
I'm currently working to put our project under php7.
当尝试编译mailparse扩展或使用pecl安装它时,出现此错误:
When trying to compile the mailparse extension or use pecl to install it, I get this error:
#error The mailparse extension requires the mbstring extension!
我确实安装了php7.0-mbstring,并尝试将mbstring扩展名与mailparse源代码一起放置.我还尝试使用以前的C技能,并尝试自己添加库,但没有成功.
I did install the php7.0-mbstring and tried to put the mbstring extension with the mailparse source code. I also tried to use my old C skills and try include the libraries myself without success.
你们中的每个人都知道我该如何解决我的问题? (无需像在某些论坛中看到的那样编辑代码)
Any of you has an idea how I could solve my problem? (without editing the code like I saw in some forums)
谢谢
推荐答案
您应该能够下载mailparse源,在mailparse.c
中注释掉HAVE_MBSTRING
的测试(在第34行附近),然后正常进行构建.
You should be able to download the mailparse source, comment out the test for HAVE_MBSTRING
in mailparse.c
(around line 34), and build it normally.
这是我在Ubuntu 16.04中所做的(必要时假设为"sudo"):
Here's what I did in Ubuntu 16.04 (assume 'sudo' when 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
然后,您只需要在PHP配置中启用mailparse.so
模块即可.
Then you just need to enable the mailparse.so
module in your PHP configuration.
对于Ubuntu 16.04和PHP-FPM,您将使用:
For Ubuntu 16.04 and PHP-FPM, you'd use:
echo "extension=mailparse.so" > \
/etc/php/7.0/fpm/conf.d/30-mailparse.ini
service php7.0-fpm reload
这篇关于安装mailparse php7 mbstring错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!