安装php-xml和php-xml7.0后,在Ubuntu 14.04上出现“未找到XML扩展”的错误

时间:2021-08-30 07:13:56

I wanna use the pecl command to install redis to my php on Ubuntu 14.04. But my Pear is giving me a list of warnings:

我想在Ubuntu 14.04上使用pecl命令将redis安装到我的php中。但是我的梨给了我一个警告的列表:

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: honorsbaseinstall in Role.php on line 173

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: installable in Role.php on line 139

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: phpfile in Role.php on line 204

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Notice: Undefined index: config_vars in Role.php on line 46

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in PEAR/Command.php on line 249

Warning: Invalid argument supplied for foreach() in /usr/share/php/PEAR/Command.php on line 249
XML Extension not found

Last line gives me this message

最后一行给了我这个信息

XML Extension not found

XML扩展未找到

, although I installed #sudo apt-get install php-xml php7.0-xml. But the same problem still occurs.

,尽管我安装了#sudo apt-get安装php-xml php7.0-xml。但同样的问题仍然存在。

What could be the problem?

有什么问题呢?

2 个解决方案

#1


10  

On some installations, there is a bug in pecl. Find this line;

在一些安装中,pecl中有一个错误。找到这条线;

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 "$@" 

remove the -n

删除- n

If you want to script it, try:

如果您想要编写脚本,请尝试:

sed -i "$ s|\-n||g" /usr/bin/pecl

#2


7  

Install this list and everything will work fine :)

安装这个列表,一切都会很好:)

sudo apt-get install php-pear pkg-config libbson-1.0 libmongoc-1.0-0 php-xml php7.0-xml php-dev

#1


10  

On some installations, there is a bug in pecl. Find this line;

在一些安装中,pecl中有一个错误。找到这条线;

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 "$@" 

remove the -n

删除- n

If you want to script it, try:

如果您想要编写脚本,请尝试:

sed -i "$ s|\-n||g" /usr/bin/pecl

#2


7  

Install this list and everything will work fine :)

安装这个列表,一切都会很好:)

sudo apt-get install php-pear pkg-config libbson-1.0 libmongoc-1.0-0 php-xml php7.0-xml php-dev