I was trying to install PHPUnit today, but the box wouldn’t allow me because the Pear Installer version wasn’t current. But there was no obvious way to upgrade the pear installer.
[root@ci /]# pear install phpunit/PHPUnit Did not download optional dependencies: pear/Image_GraphViz, pear/Log, channel://pear.symfony-project.com/YAML, use --alldeps to download automatically phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed version is 1.4.9 phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version >= 1.2.1) phpunit/PHPUnit can optionally use package "pear/Log" phpunit/PHPUnit can optionally use package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) phpunit/PHPUnit can optionally use PHP extension "json" phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5) No valid packages found install failed
The trick is to install the PEAR package with –force to make it go through
[root@ci /]# pear upgrade --force PEAR warning: pear/PEAR dependency package "pear/Archive_Tar" installed version 1.3.6 is not the recommended version 1.3.3 warning: pear/Archive_Tar requires PEAR Installer (version >= 1.5.4), installed version is 1.4.9 downloading PEAR-1.9.0.tgz ... Starting to download PEAR-1.9.0.tgz (291,634 bytes) .............................................................done: 291,634 bytes downloading Archive_Tar-1.3.6.tgz ... Starting to download Archive_Tar-1.3.6.tgz (17,600 bytes) ...done: 17,600 bytes upgrade ok: channel://pear.php.net/Archive_Tar-1.3.6 upgrade ok: channel://pear.php.net/PEAR-1.9.0 PEAR: Optional feature webinstaller available (PEAR's web-based installer) PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer) PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer) To install use "pear install pear/PEAR#featurename"
From there, you can continue on the the PHPUnit Install
wow..excellent solution…thanks Brandon….~Mark.
It actually does not help. I have PHP 5.3.3 and PEAR 1.9.0 and installing PHPUnit 3.5 requries PEAR 1.9.1
I’ve tried pear upgrade –force PEAR, but pear version remains 1.9.0 and phpunit installation complains about old PEAR. Any ideas?
Exactly what I was looking for thanks!!!
For google:
I was trying to install pear Mail on Centos 5.5 and i was failing.
pear install Mail
Did not download optional dependencies: pear/Net_SMTP, use –alldeps to download automatically
pear/Mail requires PEAR Installer (version >= 1.5.6), installed version is 1.4.9
pear/Mail can optionally use package “pear/Net_SMTP” (version >= 1.4.1)
No valid packages found
install failed