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

后端 未结 2 742
无人共我
无人共我 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: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

提交回复
热议问题