在Mac OS X/MAMP上升级PEAR [英] Upgrading PEAR on Mac OS X / MAMP

查看:106
本文介绍了在Mac OS X/MAMP上升级PEAR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac OS X上安装PHPUnit,并且当前的PEAR版本遇到问题.现有的SO问题无法解决问题.当前的PEAR版本列为1.9.1. PHPUnit需要1.9.4.

I am installing PHPUnit on Mac OS X and I am having problems with my current PEAR version. Existing SO questions don't resolve the problem. The current PEAR version is listed as 1.9.1. PHPUnit requires 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 PEAR 1.9.4之后,应该已安装,并且running pear upgrade pear表明"我们是最新版本.

After running pear install -f pear PEAR 1.9.4 is supposedly installed, and running pear upgrade pear "indicates" that we are at the latest version.

[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

但是,当运行pear install phpunit/PHPUnit时,它表示相反:

However when pear install phpunit/PHPUnit is run, it says otherwise:

[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/pear中安装了一个PEAR,但现在已经不存在了:

There used to be a PEAR installed in /usr/bin/pear but it's no longer there:

[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

我不知道我在这里缺少什么.死了!

I have no clue as to what I am missing here. Halp!

推荐答案

您在计算机上安装了两个pear,如 https中所述://stackoverflow.com/a/6596669/282601

You have two pear installations on your machine, as described on https://stackoverflow.com/a/6596669/282601

您正在执行的pear命令不是自行更新,而是第二次安装.

The pear command you're executing is not updating itself but the second installation.

唯一的解决方案是配置pear,以便通过更改pear config-show中的路径进行自我升级-或丢弃所有安装并从头开始安装.

The only solution is to configure pear so that it upgrades itself, by changing the paths in pear config-show - or to throw all installations away and install from scratch.

这篇关于在Mac OS X/MAMP上升级PEAR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆