Skip to content

PHPUnit error: No release available for package

Jun 10, 2011 1 min read #phpunit

This post is more than 18 months old. Technology changes quickly, so some of this content may be out of date (but that's not always the case). Please verify any technical or programming information against the current release.

One of the steps to install PHPUnit is to execute the following pear commands:

pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
bash

However, after doing that, I got the following error: no release available for package pear.phpunit.de/PHPUnit - and the install failed.

I decided to execute a remote-list command - it was a thought that maybe I could see if maybe my phpunit declaration was wrong - I was just grasping at straws…

pear remote-list -c phpunit
bash

This finally gave me a worthwhile error!

The value of the config option cache_dir (/tmp/pear/cache) is not a directory and attempts to create the directory have failed
output

So, I finally was successful after the following two commands:

mkdir /tmp/pear/cache
pear install phpunit/PHPUnit
bash

Moral of the story: check to make sure PEAR has a cache directory available if you can’t install a PEAR package.