Windows Installing PHPUnit via PEAR - Installing PHPUnit via PEAR

后端 未结 6 1875
迷失自我
迷失自我 2020-12-13 10:03

When I run:

peardev install phpunit/PHPUnit

I get the following:

No releases available for package \"pear.phpunit.de/PHPUni         


        
相关标签:
6条回答
  • 2020-12-13 10:24
    could not extract the package.xml file from "C:\Program Files\PHP\tmp\YAML-1.0.5
    .tgz" Unable to create directory 'C:/Program/tmpFA83.tmp'
    Unable to create path for C:/Program/tmpFA83.tmp/package.xml
    

    This is a bug in pear installer. It can't deal with the SPACE in your path and tries to read the wrong files. Installing your php in a folder without a space is the only 'fix' i know about :/


    Update 5:

    pear install --force --alldeps pear/pear
    

    do all channel updates it asks for

    pear install --force --alldeps phpunit/PHPUnit
    

    if asked for channel updates, do those and repeat

    0 讨论(0)
  • 2020-12-13 10:24

    if the Pear command didn't work try this:

    First off I'm assuming xampp is installed to C:\xampp

    1. Open a command prompt and go to C:\xampp\php
    2. Type "pear update-channels" (updates channel definitions)
    3. Type "pear upgrade" (upgrades all existing packages and pear)
    4. Type "pear channel-discover components.ez.no" (this is needed for PHPUnit)
    5. Type "pear channel-discover pear.symfony-project.com" (also needed by PHPUnit)
    6. Type "pear channel-discover pear.phpunit.de" (This IS phpunit)
    7. Type "pear install --alldeps phpunit/PHPUnit" (installs PHPUnit and all dependencies)
    0 讨论(0)
  • 2020-12-13 10:32

    make sure you're running command prompt as administrator and follow this

    pear channel-discover pear.phpunit.de
    pear channel-discover components.ez.no
    pear channel-discover pear.symfony-project.com
    
    pear install phpunit/PHPUnit
    
    0 讨论(0)
  • 2020-12-13 10:35

    You have several PEAR versions installed and are executing the wrong one. See Pear on windows displaying different version numbers for how to fix it.

    0 讨论(0)
  • 2020-12-13 10:36

    I'm a really newbie but hope to be of any help.

    I just succeeded installing PHPUnit a moment ago.

    My env. is Wamp2.1.

    I don't know exactly how this works but it worked for me, so try this.

    pear clear-cache then,

    pear install -a -f phpunit/PHPUnit
    

    Somewhere in the failing message, I saw something about cache so I used clear-cache.

    It did some trick in installing process, I guess.

    Good luck!

    0 讨论(0)
  • 2020-12-13 10:38

    From the manual page

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

    Make sure you have the two extra channels that are required.

    Edit:

    Try following this advice: pear update-channels

    0 讨论(0)
提交回复
热议问题