Search code examples
phpphpunitpearredhat

Not able to upgrade PEAR 1.8.0 to higher version on redhat


I am using php 5.2.10 on redhat. Default installed pear package is PEAR 1.8.0. Now i want to install PHPunit via pear. So whenever i run command to install phpunit, it gives error :

pear install --alldeps phpunit/PHPUnit

phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is         1.8.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version   is 1.8.0
phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.2.2)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0  
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.8.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.8.0
No valid packages found
install failed

I have tried command to upgrade pear:

pear upgrade pear
pear upgrade --force pear

but it returns :

Nothing to upgrade

Any solutions?


Solution

  • try this command :

    pear upgrade --force http://pear.php.net/get/PEAR-1.9.4.tar
    

    It will download the tar of pear 1.9.4 and upgrade the version.
    If it is not working,check whether your php supports .zlib or not. If it is not supported then configure your php with.zlib by this command:

    ./configure --with zlib
    

    check this by phpinfo command on browser,it will support zlib in your php info page.
    Run the above command to upgrade your pear version and check it by:

    pear version
    

    It will show your pear version as 1.9.4

    then run command:

    pear install --alldeps phpunit/PHPUnit