Installing Predis Error : Download of "nrk/Predis" succeeded, but it is not a valid package archive

StackOverflow https://stackoverflow.com/questions/19267463

Question

I've a new EC2 instance with PHP 5.5.4 and I am trying to install Predis from Pear. Every time I try to install Predis from pear I keep having the following error.

Anyone has an idea on why is this happening? I googled lots for a solution and I cant find an answer

root@ip-xxx-xx-xx-xxx:/etc/nginx# pear install nrk/Predis
downloading Predis-0.8.4.tgz ...
Starting to download Predis-0.8.4.tgz (177,785 bytes)
.....................................done: 177,785 bytes
Parsing of package.xml from file "/tmp/pear/temp/pearxTtEHW/package.xml" failed
Download of "nrk/Predis" succeeded, but it is not a valid package archive
Error: cannot download "nrk/Predis"
Download failed
install failed
Était-ce utile?

La solution

PHP 5.5 changed the way unpack works (http://php.net/manual/en/migration55.incompatible.php) so some PEAR or PECL packages are no longer compatible. You can install the package manually. I think it was also fixed in the pear repository, but I'm not sure. It has not been released though.

Autres conseils

Seems that Pear can't install from tgz archive. You have to explicitly request uncompressed files when downloading with -Z, --nocompress option.

So, try sudo pear install -Z package

The best solution for this is to upgrade PEAR's Archive package, which the pear installer uses, and after that you won't need to explicitly request uncompressed files when installing or upgrading existing packages.

$ sudo pear upgrade -Z Archive_Tar
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top