在Mac OS X / MAMP升级PEAR(Upgrading PEAR on Mac OS X

2019-10-30 17:13发布

我在Mac OS X上安装PHPUnit的,我有我的当前版本PEAR问题。 现有的SO问题不解决问题。 目前PEAR版本被列为1.9.1。 PHPUnit的要求1.9.4。

[le programmeur]$which pear
/Applications/MAMP/bin/php5.3/bin/pear

[le programmeur]$pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0

[le programmeur]$pear config-get php_dir
/Users/rallen8440/pear/share/pear

运行后pear install -f pear梨1.9.4据称是安装和running pear upgrade pear “表示”我们是在最新的版本。

[le programmeur]$/Applications/MAMP/bin/php5.3/bin/pear install -f pear
WARNING: "pear/Console_Getopt" is deprecated in favor of "pear/Console_GetoptPlus"
downloading PEAR-1.9.4.tgz ...
Starting to download PEAR-1.9.4.tgz (296,332 bytes)
.............................................................done: 296,332 bytes
install ok: channel://pear.php.net/PEAR-1.9.4
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"
[le programmeur]$/Applications/MAMP/bin/php5.3/bin/pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0

[le programmeur]$pear upgrade pear
pear/pear is already installed and is the same as the released version 1.9.4
upgrade failed

然而,当梨安装PHPUnit / PHPUnit的运行时,它说,否则:

[le programmeur]$pear install phpunit/PHPUnit
Did not download optional dependencies: phpunit/PHP_Invoker, use --alldeps to download automatically
phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHPUnit can optionally use package "phpunit/PHP_Invoker" (version >= 1.1.0)
phpunit/File_Iterator requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHP_CodeCoverage requires package "phpunit/File_Iterator" (version >= 1.3.0)
phpunit/PHP_CodeCoverage requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_CodeCoverage can optionally use PHP extension "xdebug" (version >= 2.0.5)
phpunit/PHP_Timer requires PEAR Installer (version >= 1.9.2), installed version is 1.9.1
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
phpunit/PHPUnit_MockObject requires package "phpunit/Text_Template" (version >= 1.1.1)
phpunit/PHP_TokenStream requires PEAR Installer (version >= 1.9.4), installed version is 1.9.1
No valid packages found
install failed

[le programmeur]$pear -V
PEAR Version: 1.9.1
PHP Version: 5.3.5
Zend Engine Version: 2.3.0

曾经有安装在/ usr / bin中/梨梨一个,但它不再存在:

[le programmeur]$ls /usr/bin/pear
pear_old  peardev

~/.profile路径指向/Applications/MAMP/bin/php5.3/bin

# Mod path
export PATH=/Applications/MAMP/bin/php5.3/bin:$PATH

我不知道是什么,我是缺少在这里。 HALP!

Answer 1:

你有你的机器上有两个梨装置,作为描述https://stackoverflow.com/a/6596669/282601

pear你执行命令不更新自己,但第二次安装。

唯一的解决办法是配置梨,使其升级本身,通过改变路径pear config-show -或扔掉所有安装路程,从头开始安装。



文章来源: Upgrading PEAR on Mac OS X / MAMP