Upgrading PEAR on Mac OS X / MAMP - php

I am installing PHPUnit on Mac OS X and I am having problems with my current PEAR version. Existing SO questions don't resolve the problem. The current PEAR version is listed as 1.9.1. PHPUnit requires 1.9.4.
[le programmeur]$which pear
/Applications/MAMP/bin/php5.3/bin/pear
[le programmeur]$pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0
[le programmeur]$pear config-get php_dir
/Users/rallen8440/pear/share/pear
After running pear install -f pear PEAR 1.9.4 is supposedly installed, and running pear upgrade pear "indicates" that we are at the latest version.
[le programmeur]$/Applications/MAMP/bin/php5.3/bin/pear install -f pear
WARNING: "pear/Console_Getopt" is deprecated in favor of "pear/Console_GetoptPlus"
downloading PEAR-1.9.4.tgz ...
Starting to download PEAR-1.9.4.tgz (296,332 bytes)
.............................................................done: 296,332 bytes
install ok: channel://pear.php.net/PEAR-1.9.4
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)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
[le programmeur]$/Applications/MAMP/bin/php5.3/bin/pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0
[le programmeur]$pear upgrade pear
pear/pear is already installed and is the same as the released version 1.9.4
upgrade failed
However when pear install phpunit/PHPUnit is run, it says otherwise:
[le programmeur]$pear install phpunit/PHPUnit
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.3.0)
phpunit/PHP_CodeCoverage requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHP_Timer requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHPUnit_MockObject requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
No valid packages found
install failed
[le programmeur]$pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0
There used to be a PEAR installed in /usr/bin/pear but it's no longer there:
[le programmeur]$ls /usr/bin/pear
pear_old peardev
The ~/.profile PATH is pointing to /Applications/MAMP/bin/php5.3/bin:
# Mod path
export PATH=/Applications/MAMP/bin/php5.3/bin:$PATH
I have no clue as to what I am missing here. Halp!

You have two pear installations on your machine, as described on https://stackoverflow.com/a/6596669/282601
The pear command you're executing is not updating itself but the second installation.
The only solution is to configure pear so that it upgrades itself, by changing the paths in pear config-show - or to throw all installations away and install from scratch.

Related

Pear and PHPUnit are completely failing to work [duplicate]

I read the other PHPUnit installation questions but haven't had any success. What is going on with my PEAR install?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.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.9.0
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
No valid packages found
install failed
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Cache_Lite 1.7.11 stable
Console_Getopt 1.3.1 stable
HTTP_Request2 2.0.0RC1 beta
Net_URL2 0.3.1 beta
PEAR 1.9.3 stable
Structures_Graph 1.0.4 stable
XML_RPC2 1.1.1 stable
XML_Util 1.2.1 stable
greg#ubuntu:~$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
pear list reports 1.9.3 installed, pear -V reports 1.9.0!?!
Update Tried KingCrunch suggestion.
$ sudo pear install -f pear
[sudo] password for greg:
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
...........................done: 295,774 bytes
install ok: channel://pear.php.net/PEAR-1.9.3
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)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
You basically have 2 pear installations on your machine, and the "pear upgrade" command updates the other one, not itself.
I assume that the pear version you're running has been installed via ubuntu's apt.
Find out where it has been installed with apt (on Debian/Ubuntu):
$ dpkg -L php-pear
...
/usr/share/php/PEAR.php
...
/usr/bin/pear
Now let's see where pear installs the files to:
$ pear config-get php_dir
/usr/share/php
On my machine, it is the same - but probably not on yours, which is the problem. Fix it by setting the php_dir, as well as the bin_dir:
$ pear config-set php_dir /usr/share/php
$ pear config-set bin_dir /usr/bin
Alternatively, remove the ubuntu pear and install it freshly from http://pear.php.net/go-pear.phar
If you are not successful with the pear part have a look at this.
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
ref: http://phpunit.de/manual/3.7/en/installation.html
You can also immediately use the PHAR after you have downloaded it;
wget https://phar.phpunit.de/phpunit.phar
php phpunit.phar

PEAR fails to install on Ubuntu 12.x [duplicate]

I read the other PHPUnit installation questions but haven't had any success. What is going on with my PEAR install?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.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.9.0
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
No valid packages found
install failed
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Cache_Lite 1.7.11 stable
Console_Getopt 1.3.1 stable
HTTP_Request2 2.0.0RC1 beta
Net_URL2 0.3.1 beta
PEAR 1.9.3 stable
Structures_Graph 1.0.4 stable
XML_RPC2 1.1.1 stable
XML_Util 1.2.1 stable
greg#ubuntu:~$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
pear list reports 1.9.3 installed, pear -V reports 1.9.0!?!
Update Tried KingCrunch suggestion.
$ sudo pear install -f pear
[sudo] password for greg:
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
...........................done: 295,774 bytes
install ok: channel://pear.php.net/PEAR-1.9.3
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)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
You basically have 2 pear installations on your machine, and the "pear upgrade" command updates the other one, not itself.
I assume that the pear version you're running has been installed via ubuntu's apt.
Find out where it has been installed with apt (on Debian/Ubuntu):
$ dpkg -L php-pear
...
/usr/share/php/PEAR.php
...
/usr/bin/pear
Now let's see where pear installs the files to:
$ pear config-get php_dir
/usr/share/php
On my machine, it is the same - but probably not on yours, which is the problem. Fix it by setting the php_dir, as well as the bin_dir:
$ pear config-set php_dir /usr/share/php
$ pear config-set bin_dir /usr/bin
Alternatively, remove the ubuntu pear and install it freshly from http://pear.php.net/go-pear.phar
If you are not successful with the pear part have a look at this.
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
ref: http://phpunit.de/manual/3.7/en/installation.html
You can also immediately use the PHAR after you have downloaded it;
wget https://phar.phpunit.de/phpunit.phar
php phpunit.phar

Unable to upgrade PEAR from 1.9.2 to 1.9.4

I am on a Ubuntu 11.10 and trying to upgrade from 1.9.2 to 1.9.4, but it simply don't work. Here are the commands I am following in sequence
$ sudo apt-get install php-pear
Reading package lists... Done
Building dependency tree
Reading state information... Done
php-pear is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-3.0.0-14-generic-pae libaccess-bridge-java-jni libaccess-bridge-java
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
$ sudo pear channel-update pear.php.net
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
$ sudo pear upgrade-all
Nothing to upgrade-all
$ sudo pear install –alldeps pear.phpunit.de/PHPUnit
parsePackageName(): invalid package name "–alldeps" in "–alldeps"
invalid package name/package file "–alldeps"
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHP_CodeCoverage requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
phpunit/PHPUnit_MockObject requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
No valid packages found
install failed
Any thoughts?
There are two - required before the alldeps option! Try it with --alldeps and --force:
sudo pear install -–alldeps --force pear.phpunit.de/PHPUnit

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?
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
If you use RHEL 6, you have php-pear >= 1.9.4
You just have to update via yum, like yum install php-pear
But if you do this, it will maybe update your php installation too. You will have a list of all package to update and you have the choice to accept or cancel.
If pear tells you "nothing to upgrade", you should clear the cache:
$ pear clear-cache
$ pear upgrade pear

Can't install PHPUnit via PEAR, requires PEAR Installer >= 1.9.2, can't upgrade PEAR from 1.9.0

I read the other PHPUnit installation questions but haven't had any success. What is going on with my PEAR install?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Channel "pear.php.net" is up to date
Updating channel "pear.phpunit.de"
Channel "pear.phpunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install phpunit/PHPUnit
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHPUnit can optionally use PHP extension "dbus"
phpunit/DbUnit requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1), installed version is 1.9.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.9.0
phpunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2), installed version is 1.9.0
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1), installed version is 1.9.0
No valid packages found
install failed
$ pear list
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Cache_Lite 1.7.11 stable
Console_Getopt 1.3.1 stable
HTTP_Request2 2.0.0RC1 beta
Net_URL2 0.3.1 beta
PEAR 1.9.3 stable
Structures_Graph 1.0.4 stable
XML_RPC2 1.1.1 stable
XML_Util 1.2.1 stable
greg#ubuntu:~$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
pear list reports 1.9.3 installed, pear -V reports 1.9.0!?!
Update Tried KingCrunch suggestion.
$ sudo pear install -f pear
[sudo] password for greg:
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
...........................done: 295,774 bytes
install ok: channel://pear.php.net/PEAR-1.9.3
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)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
You basically have 2 pear installations on your machine, and the "pear upgrade" command updates the other one, not itself.
I assume that the pear version you're running has been installed via ubuntu's apt.
Find out where it has been installed with apt (on Debian/Ubuntu):
$ dpkg -L php-pear
...
/usr/share/php/PEAR.php
...
/usr/bin/pear
Now let's see where pear installs the files to:
$ pear config-get php_dir
/usr/share/php
On my machine, it is the same - but probably not on yours, which is the problem. Fix it by setting the php_dir, as well as the bin_dir:
$ pear config-set php_dir /usr/share/php
$ pear config-set bin_dir /usr/bin
Alternatively, remove the ubuntu pear and install it freshly from http://pear.php.net/go-pear.phar
If you are not successful with the pear part have a look at this.
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
mv phpunit.phar /usr/local/bin/phpunit
ref: http://phpunit.de/manual/3.7/en/installation.html
You can also immediately use the PHAR after you have downloaded it;
wget https://phar.phpunit.de/phpunit.phar
php phpunit.phar

Categories