PHP7 pecl 安裝 mongodb擴展
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: 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
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擴展