Search code examples
phpamazon-web-servicesredispearpredis

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


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

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.