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

后端 未结 2 747
无人共我
无人共我 2020-11-29 10:59

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 cha         


        
相关标签:
2条回答
  • 2020-11-29 11:52

    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
    
    0 讨论(0)
  • 2020-11-29 11:54

    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

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