As part of getting an upgraded server set up and transferring sites from the older server, I had to re-install PEAR XML_RSS. One of its dependencies is XML_Tree.
Normally, this command should have worked with no problems:
pear install XML_RSS
It downloaded XML_RSS just fine, but then choked on XML_Tree, which was a required dependency.
# pear install XML_RSS
Did not download dependencies: pear/XML_Tree, use --alldeps or --onlyreqdeps to download automatically
pear/XML_RSS requires package "pear/XML_Tree"
No valid packages found
My next try was to specify installing XML_Tree:
# pear install XML_Tree
WARNING: "pear/XML_Tree" is deprecated in favor of "pear/XML_Serializer"
downloading XML_Tree-1.1.tgz ...
Starting to download XML_Tree-1.1.tgz (4,826 bytes)
.....done: 4,826 bytes
XML error: not well-formed (invalid token) at line 10
Download of "pear/XML_Tree" succeeded, but it is not a valid package archive
Error: cannot download "pear/XML_Tree"
After some troubleshooting, here is how I fixed this problem:
- Change directory into the PEAR download cache directory:
- Clear out all the old cache files:
- You should see the downloaded file: XML_Tree-1.1.tgz
- Extract the files:
tar xvfz XML_Tree-1.1.tgz
- Now edit the extracted package.xml file:
- Go to line 10 and change the Ã¶ to an o. This is the character that is causing the XML validation of the package file to fail. Next, save the file (
- Next, remove the old .tgz file:
rm -rf XML_Tree-1.1.tgz
- We’re going to recreate the package:
tar cfv - package.xml XML_Tree-1.1/ | gzip > XML_Tree-1.1.tgz
- Next, we’re going to install this package and not use the network:
pear install -O XML_Tree-1.1.tgz
XML_Tree is now installed. You should now be able to continue installing XML_RSS normally.