Pear error "XML Extension not found" on Ubuntu 14.04 after installing php-xml & php-xml7.0
26,312
Solution 1
On some installations, there is a bug in pecl. Find this line;
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
If you want to script it, try:
sed -i "$ s|\-n||g" /usr/bin/pecl
Solution 2
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
Solution 3
Was Facing this issue, i just needed to install php-xml
sudo apt-get install php-xml
Credits: Taha EL BOUFFI
Full Explanation as to why can be found here
Author by
Towen
Updated on March 06, 2020Comments
-
Towen about 4 years
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:
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
, although I installed
#sudo apt-get install php-xml php7.0-xml
. But the same problem still occurs.What could be the problem?
-
vuryss over 7 yearsAlso please do show us the code where those errors are on. We cannot guess.
-
DaGhostman Dimitrov over 7 yearsI have encountered this issue recently on my local machine, I think it is related to incompatibilities between hte
php7.0
package andphp5-pear
(I was using the 'dotdeb' repository and had pretty similar problems) -
DaGhostman Dimitrov over 7 years@vuryss wut? These errors are shown when the OP is issuing
pear
command from terminal. There is no code involved in the question -
Towen over 7 years@DaGhostmanDimitrov Yes I'm getting this error while using this command : "sudo pecl install redis".
-
vuryss over 7 yearsYea I overlooked the lines. My bad. I doubt most of the pear libs are updated for php7.
-
DaGhostman Dimitrov over 7 years@vuryss it is an error with pear itself, also
redis
extension builds just fine for PHP7 (use it in a deployed docker image) also many(majority of popular ones) of the extensions are compatible with PHP7 -
Towen over 7 yearsAlso reinstalling pear doesnt work so it has to be a php error I think
-
cweiske over 7 yearsMake sure the pear version is 1.10.x
-
-
Chris almost 7 yearsRunning Ubuntu 16.04 LTS with the same issue. Removed "-n" from pecl file and warnings were fixed. Thank you richp10!
-
leymannx over 6 yearsThat is mucho O_o
-
EthraZa almost 6 yearsThank you... it worked in Ubuntu 16.04.4 with PHP 7.1 (+deb.sury.org).
-
Jackie about 5 yearsCurrent PHP version: 7.2.16-1+ubuntu18.10.1+deb.sury.org+1. doesn't work for me :(
-
raghu777 about 4 yearsThanks. This worked on CentOS Linux release 7.7.1908 (Core)