码迷,mamicode.com
首页 > 数据库 > 详细

PHP7 pecl 安装 mongodb扩展

时间:2018-03-28 21:03:20      阅读:1408      评论:0      收藏:0      [点我收藏+]

标签:mongodb   php   

Hi,

I‘m running alpine 3.3 in docker with the testing repo for php7 packages, after installing php7-pear, and trying to run pecl I get a bunch of warnings/notices :

~ # pecl
Warning: Invalid argument supplied for foreach() in Command.php on line 249
Warning: Invalid argument supplied for foreach() in /usr/share/php7/PEAR/Command.php on line 249
Notice: Undefined index: honorsbaseinstall in Role.php on line 173
Notice: Undefined index: installable in Role.php on line 139
Notice: Undefined index: phpfile in Role.php on line 204
Notice: Undefined index: config_vars in Role.php on line 46
And if I try to install mongodb for example, I‘ll get the same warnings as before with an extra "XML Extension not found" at the end.

I compared the "/usr/bin/pecl" with one from ubuntu and the only difference is the "-n" in the exec line :

alpine:
exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"

ubuntu:
exec $PHP -C -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "$@"

-n meaning: "No configuration (ini) files will be used"
If not using conf, xml won‘t be loaded, so I‘m pretty sure the "-n" should be removed.

I tested after removing it, and got no warning or anything and was able to install my extension.

sumery: vi /usr/bin/pecl remove -n para

PHP7 pecl 安装 mongodb扩展

标签:mongodb   php   

原文地址:http://blog.51cto.com/livestreaming/2092162

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!