[SOLVED][PHP PEAR] How to fix the error 'could not extract the package.xml file' and 'Download of "pecl/uploadprogress" succeeded, but it is not a valid package archive', when trying to install PECL uploadprogress using PHP PEAR on Ubuntu 14.04 Trusty

Setting up, upgrading and maintaining a clean and functional Drupal/PHP Development environment is an art, and quite a piece of cake for the skilled sysadmin. But the ever changing versions of OS packages and dependencies can bring up quite some unexpected challenges to a budding developer. Here is the solution to one such error that might eat your brains out.

Almost all usable versions of Drupal - 6, 7 and 8 - use PECL uploadprogress to show file upload progress.
And installing it on previous Ubuntu, PHP versions was as easy as running the following command:

sudo pecl install uploadprogress

But lately, when trying to install uploadprogress on fresh Ubuntu 14.04.1 Trusty Tahr the same way, it has been showing up the following error:

could not extract the package.xml file from "/build/buildd/php5-5.5.9+dfsg/pear-build-download/uploadprogress-1.0.3.1.tgz"
Download of "pecl/uploadprogress" succeeded, but it is not a valid package archive
Error: cannot download "pecl/uploadprogress"
Download failed
install failed

Solution:

To work around this without breaking your package manager's system, you can install by telling the command (using the '-Z' option) to download the uncompressed version of the archive while installing.
For the above case, you can use the following command:

sudo pecl install -Z uploadprogress

Comments

This work for me. I want to install the following packages
sudo pear install mail
sudo pear install Net_SMTP
sudo pear Auth_SASL
sudo pear install mail_mime
but it gives me the same error which you face. I just add "-Z" before the package name e.g. "sudo pear install -Z Net_SMTP" and it works.

Thanks for this lovely sharing....

Wow.. its working fine..

thanks i need sudo pecl install -Z dbase , and run ok. my server is very good. thanks for you help.

thanks for you help.
is fine all the code.

I have been knocking my head against a wall trying to run "sudo pecl install redis" with failures even though I could see the files there fine, could extract them etc.

Adding the -Z to make "sudo pecl install -Z redis" worked fine! Thanks.

Great work around. It works fine ! Many thanks.

Add new comment

randomness