ubuntu – 无法通过PEAR安装PHPUnit,需要PEAR Installer> = 1.9.2,不能从1.9.0升级PEAR

前端之家收集整理的这篇文章主要介绍了ubuntu – 无法通过PEAR安装PHPUnit,需要PEAR Installer> = 1.9.2,不能从1.9.0升级PEAR前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我读了其他PHPUnit的安装问题,但没有取得任何成功。我的PEAR安装正在发生什么?
$ sudo pear update-channels
Updating channel "components.ez.no"
Channel "components.ez.no" is up to date
Updating channel "doc.PHP.net"
Channel "doc.PHP.net" is up to date
Updating channel "pear.PHP.net"
Channel "pear.PHP.net" is up to date
Updating channel "pear.PHPunit.de"
Channel "pear.PHPunit.de" is up to date
Updating channel "pear.symfony-project.com"
Channel "pear.symfony-project.com" is up to date
Updating channel "pecl.PHP.net"
Channel "pecl.PHP.net" is up to date
$ sudo pear upgrade pear
Nothing to upgrade
$ sudo pear install PHPunit/PHPUnit
PHPunit/PHPUnit requires PEAR Installer (version >= 1.9.2),installed version is 1.9.0
PHPunit/PHPUnit can optionally use PHP extension "dbus"
PHPunit/DbUnit requires PEAR Installer (version >= 1.9.2),installed version is 1.9.0
PHPunit/File_Iterator requires PEAR Installer (version >= 1.9.2),installed version is 1.9.0
PHPunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.1),installed version is 1.9.0
PHPunit/PHP_CodeCoverage requires package "PHPunit/File_Iterator" (version >= 1.2.2)
PHPunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
PHPunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.2),installed version is 1.9.0
PHPunit/PHPUnit_Selenium requires PEAR Installer (version >= 1.9.2),installed version is 1.9.0
PHPunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.1),installed version is 1.9.0
No valid packages found
install Failed
$ pear list
Installed packages,channel pear.PHP.net:
=========================================
Package          Version  State
Archive_Tar      1.3.7    stable
Cache_Lite       1.7.11   stable
Console_Getopt   1.3.1    stable
HTTP_Request2    2.0.0RC1 beta
Net_URL2         0.3.1    beta
PEAR             1.9.3    stable
Structures_Graph 1.0.4    stable
XML_RPC2         1.1.1    stable
XML_Util         1.2.1    stable
greg@ubuntu:~$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686

梨榜报告1.9.3安装,梨-V报1.9.0!?

更新试用KingCrunch建议。

$ sudo pear install -f pear
[sudo] password for greg: 
downloading PEAR-1.9.3.tgz ...
Starting to download PEAR-1.9.3.tgz (295,774 bytes)
...........................done: 295,774 bytes
install ok: channel://pear.PHP.net/PEAR-1.9.3
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)
PEAR: To install optional features use "pear install pear/PEAR#featurename"
$ pear -V
PEAR Version: 1.9.0
PHP Version: 5.3.6
Zend Engine Version: 2.3.0
Running on: Linux ubuntu 2.6.32-32-generic-pae #62-Ubuntu SMP Wed Apr 20 22:10:33 UTC 2011 i686
您的机器上基本上有2个梨安装,“pear upgrade”命令更新另一个,而不是自己更新。

我假设你正在运行的梨版本已经通过ubuntu的apt安装了。

了解它在哪里安装apt(在Debian / Ubuntu上):

$ dpkg -L PHP-pear
...
/usr/share/PHP/PEAR.PHP
...
/usr/bin/pear

现在让我们看看梨在哪里安装文件到:

$ pear config-get PHP_dir
/usr/share/PHP

在我的机器上,它是一样的 – 但可能不在你的身上,这是问题。通过设置PHP_dir以及bin_dir来修复它:

$ pear config-set PHP_dir /usr/share/PHP
$ pear config-set bin_dir /usr/bin

或者,删除ubuntu梨,并从http://pear.php.net/go-pear.phar新鲜安装

原文链接:https://www.f2er.com/ubuntu/349266.html

猜你在找的Ubuntu相关文章