about me about me
photography photography
software projects software projects
contact me contact me
27
Mar

Snow Leopard ships with PHP 5.3.0, which at the time of writing, is quite recent (at least it’s a milestone version with a bunch of new features). I’ve not tried to install anything previously via PEAR on my Snow Leopard install.

When I tried to install PHPUnit, I ran into a problem.

$ sudo pear channel-discover pear.phpunit.de
Adding Channel "pear.phpunit.de" succeeded
Discovery of channel "pear.phpunit.de" succeeded
$ sudo pear channel-discover pear.symfony-project.com
Adding Channel "pear.symfony-project.com" succeeded
Discovery of channel "pear.symfony-project.com" succeeded
$ sudo pear install phpunit/PHPUnit
Did not download optional dependencies: pear/Image_GraphViz, pear/Log, \
symfony/YAML, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), \
installed version is 1.8.0
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 "symfony/YAML" (version >= 1.0.2)
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5)
No valid packages found
install failed

Oh noes! Time to upgrade PEAR. First check the PEAR channels are up-to-date:

$ sudo pear update-channels
Updating channel "doc.php.net"
Channel "doc.php.net" is up to date
Updating channel "pear.php.net"
Update of Channel "pear.php.net" succeeded
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"
Update of Channel "pecl.php.net" succeeded
$ sudo pear upgrade PEAR
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
downloading Structures_Graph-1.0.3.tgz ...
Starting to download Structures_Graph-1.0.3.tgz (30,191 bytes)
...done: 30,191 bytes
upgrade ok: channel://pear.php.net/Archive_Tar-1.3.6
upgrade ok: channel://pear.php.net/Structures_Graph-1.0.3
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)
PEAR: To install optional features use "pear install pear/PEAR#featurename"

Now retry installing PHPUnit.

$ sudo pear install phpunit/PHPUnit
Did not download optional dependencies: pear/Image_GraphViz, pear/Log, \
symfony/YAML, use --alldeps to download automatically
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 "symfony/YAML" (version >= 1.0.2)
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5)
downloading PHPUnit-3.4.11.tgz ...
Starting to download PHPUnit-3.4.11.tgz (254,439 bytes)
.....................................................done: 254,439 bytes
install ok: channel://pear.phpunit.de/PHPUnit-3.4.11

We’re good to go.


comments

4F2E4A2E // 08.Nov.2010 // 22:03

after installing snow leopard from the scratch and folowing you instructions i got this:
———————
$ sudo pear install phpunit/PHPUnit
Unknown remote channel: components.ez.no
Unknown remote channel: components.ez.no
phpunit/PHPUnit can optionally use PHP extension “dbus”
phpunit/PHP_CodeCoverage requires package “channel://components.ez.no/ConsoleTools” (version >= 1.6)
phpunit/PHP_CodeCoverage can optionally use PHP extension “xdebug” (version >= 2.0.5)
phpunit/PHPUnit requires package “phpunit/PHP_CodeCoverage” (version >= 1.0.0)
phpunit/PHP_TokenStream requires package “channel://components.ez.no/ConsoleTools” (version >= 1.6)
No valid packages found
install failed
———————
i am getting crazy

George Tarantilis // 19.Nov.2010 // 10:13

Thank you so much.
I had problems installing phpunit. (Mac OS X 10.6.5)

Upgrading PEAR to 1.9.1 did the trick.

Thanks!!

John Crepezzi // 05.Feb.2011 // 06:03

Thanks for the hints – I also had to do:
sudo pear channel-discover components.ez.no

Ravi // 28.Mar.2011 // 23:02

John Crepezzi’s tip above worked for me too

Alí Suárez // 03.Jul.2011 // 21:42

Just what I needed! Thanks!