Install PHPUnit via PEAR

I have problems installing PHPUnit 3.4.6 through PEAR 1.9.0 . After detecting the pear.phpunit.de channel and try using one of the following commands:

pear install phpunit / PHPUnit

pear install --alldeps phpunit / PHPUnit

pear install --onlyreqdeps phpunit / PHPUnit

it fails giving me the following error:

There are no releases for the package "Pear.phpunit.de/PHPUnit"

Installation error

I found several threads from people with the same problem, but PEAR to the latest version usually worked for them. Also, there seems to be no tutorials on installing PHPUnit for Windows.

EDIT:

I also tried changing prefered_state to beta; did not help.

I also tried to get a list of all available packages:

pear remote-list -c phpunit

This is another mistake:

Unable to load non-http url "/c/categories.xml"

+75
php phpunit pear
Jan 05 '10 at
source share
13 answers

I had the same problem yesterday, and I solved it by updating the channels

pear clear-cache pear update-channels 

before trying to install phpUnit.

Hope this helps.

+114
Jan 15 '10 at 9:09
source share

I had the same problem, try:

 pear clear-cache 
+158
Jul 12 2018-11-11T00:
source share

It just sets me up when I type:

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

There may be a version problem, you can set preferred_state for pear packages no more stable :

 pear config-set preferred_state beta 
+12
Jan 05 '10 at 15:09
source share

Follow these steps:

  • one.
pear config-set auto_discover 1
  • 2.
pear install pear.phpunit.de/PHPUnit -> here I got it: the installation failed.
  • 3. Try:
pear clear-cache -> succeeded
  • four.
pear update-channels -> succeeded
  • 5.
pear install pear.phpunit.de/PHPUnit -> successfully completed.
+12
Dec 25 '12 at 8:23
source share

I had the same problem. this worked for me:

 sudo pear clear-cache sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com pear install --alldeps phpunit/PHPUnit 
+10
Nov 01 2018-11-11T00:
source share

What is the complete error message output? I did not succeed until I installed using the --alldeps option and executed pear channel-discover pear.symfony-project.com

 sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear install --alldeps phpunit/PHPUnit 
+5
Jan 05 '10 at 17:13
source share

From 2014-12-31, the PEAR installer was no longer the only installation method for PHPUnit. See here: https://github.com/sebastianbergmann/phpunit/wiki/End-of-Life-for-PEAR-Installation-Method

+3
Mar 18 '15 at 13:39
source share

I tried

 pear update-channels 

as suggested by Davide above, but it gave me an error

 Channel pear.php.net does not support xml-rpc method channel.listAll 

For some reason, it worked when I ran

 pear channel-update pear.phpunit.de 
+2
Nov 16 '10 at 15:51
source share

You also need to open the ezcomponents channel using pear channel-discover components.ez.no

Total:

 sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear channel-discover components.ez.no sudo pear install --alldeps phpunit/PHPUnit 

You can quickly check the health to run phpunit from the CLI and see if the command is recognized.

UPDATE

It seems they moved symfony, I just did a new install today, here is a new channel

 sudo pear channel-discover pear.symfony.com 
+2
Jul 30 2018-11-11T00:
source share

I have the same problem installing phpunit. Try using the Synaptic package manager to install PHPUnit.

 sudo pear install pear # upgrade pear first #install php unit with synaptic manager phpunit --version # get version of phpunit 
+1
May 06 '11 at 12:24
source share

For a long time I tried to struggle with ZEND, etc., to work on XAMPP in Windows Vista. For reference, I decided: -

Failed to update PEAR, then I realized that the default parameter value was wrong, I am correcting this guide ...

http://david-franklin.net/programming/installing-pear-phpunit-on-windows/

Then I was able to install PHPUNIT using the pear clear_cache thanks to this thread, and then run "pear install phpunit / PHPunit".

I hope that what I wrote above will serve as a quick code for those in a similar predicament (it took me two whole days to get it working !!!)

+1
Sep 04 2018-11-11T00:
source share

I had a problem with the lack of the required YAML dependency, so I got a warning every time.

Try pear channel-discover pear.symfony.com pear install pear.symfony.com/Yaml

then download again

 pear install --alldeps pear.phpunit.de/PHPUnit 
0
Nov 17 '12 at 14:12
source share

First of all, all xampp must be installed on C: \ xampp

Open a command prompt and go to C: \ xampp \ php

Type the following commands in cmd

pear update-channels "(updates channel definitions)

pear upgrade (updates all existing packages and pear)

pear channel-discover components.ez.no (necessary for PHPUnit)

pear channel-discover pear.symfony-project.com (also requires PHPUnit)

pear channel-discover pear.phpunit.de (This is IS phpunit)

pear install --alldeps phpunit/PHPUnit (installs PHPUnit and all dependencies)

0
Dec 24 '13 at 17:03
source share



All Articles