PEAR shaped!

Posted on 29 May 2014
1 minute read

Pecl extensions, some great, some OK… I was looking to install Pecl_Http on my CentOS box, except this kept throwing errors:

root@box [~/tmp]# pecl install -o pecl_http
downloading pecl_http-2.0.6.tgz ...
Starting to download pecl_http-2.0.6.tgz (152,827 bytes)
.................................done: 152,827 bytes
could not extract the package.xml file from "/root/tmp/pear/cache/pecl_http-2.0.6.tgz"
Download of "pecl/pecl_http" succeeded, but it is not a valid package archive
Error: cannot download "pecl/pecl_http"
downloading raphf-1.0.4.tgz ...
Starting to download raphf-1.0.4.tgz (7,232 bytes)
...done: 7,232 bytes
could not extract the package.xml file from "/root/tmp/pear/cache/raphf-1.0.4.tgz"
Download of "pecl/raphf" succeeded, but it is not a valid package archive
Error: cannot download "pecl/raphf"
downloading propro-1.0.0.tgz ...
Starting to download propro-1.0.0.tgz (6,217 bytes)
...done: 6,217 bytes
could not extract the package.xml file from "/root/tmp/pear/cache/propro-1.0.0.tgz"
Download of "pecl/propro" succeeded, but it is not a valid package archive
Error: cannot download "pecl/propro"
Download failed
install failed

It appears the culprit of this issue was Archive_Tar. I had 1.3.10 installed which isn’t compatible with PHP 5.5.x, but of course, we can’t simply upgrade this to 1.3.11 which is compatible, because PEAR needs Archive_Tar to upgrade itself! OK, just uninstall Archive_Tar and re-install it, except it’s a dependency of PEAR.

To fix this issue, I had to uninstall it ignoring dependencies:

pear uninstall -n Archive_Tar

Install it again:

pear install Archive_Tar

Check that everything had upgraded nicely:

root@box [~]# pear info archive_tar | head -n1
ABOUT PEAR.PHP.NET/ARCHIVE_TAR-1.3.11

Then I could set about installing Pecl_Http which went without a hiccup this time.