Trouble upgrading pecl and pear

twv

Verified User
Joined
Oct 31, 2003
Messages
217
New install of DA on a new CentOS 7 server.

pecl upgrade:
pear.php.net is using a unsupported protocol - This should never happen.
pear.php.net is using a unsupported protocol - This should never happen.
upgrade failed

Googling that error suggests that the solution is "pear upgrade". However:
pear upgrade:
downloading Archive_Tar-1.4.4.tgz ...
Starting to download Archive_Tar-1.4.4.tgz (20,886 bytes)
........done: 20,886 bytes
Could not delete /usr/local/lib/php/Archive/Tar.php, cannot rename /usr/local/lib/php/Archive/.tmpTar.php
ERROR: commit failed

Googling that comes up blank. Anybody have any suggestions?
 
It seems like there was a bug in my version of /usr/local/lib/php/PEAR/Installer.php. It was renaming the file it was upgrading, e.g. Tar.php to Tar.php.bak, and then trying to delete the original file (i.e., Tar.php). Then it aborted the upgrade when it couldn't delete Tar.php because it had been renamed.

Not sure how legitimate this is, but I "fixed" this by commenting out lines 883-885 of /usr/local/lib/php/PEAR/Installer.php like so:

PHP:
                       // if (!isset($this->_options['ignore-errors'])) {
                       //      return false;
                       //  }

and then running pear upgrade --force

Now pear upgrade and pecl upgrade run without errors.
 
Back
Top