【问题标题】:Need help upgrading PEAR to install PHPUnit需要帮助升级 PEAR 以安装 PHPUnit
【发布时间】:2012-04-08 06:41:18
【问题描述】:

我正在尝试使用 PEAR 安装 PHPUnit。这就是我正在运行的...

PEAR Version: 1.7.2
PHP Version: 5.3.8-ZS5.5.0
Zend Engine Version: 2.3.0
Running on: Windows NT L-PC 6.1 build 7600 (Windows 7 Home Premium Edition) i586

当我尝试安装时,我收到一条错误消息,提示我需要升级 PEAR...

C:\Program Files (x86)\Zend\ZendServer\bin>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.7.2
phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2)
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.7.2
phpunit/Text_Template requires PEAR Installer (version >= 1.9.4), installed version is 1.7.2
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.7.2
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.7.2
phpunit/PHPUnit_MockObject requires PEAR Installer (version >= 1.9.4), installed version is 1.7.2
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.7.2
No valid packages found
install failed

所以我想我需要升级 PEAR。我跑了 pear upgrade pear 得到了以下...

C:\Program Files (x86)\Zend\ZendServer\bin>pear upgrade pear
pear/Console_Getopt requires PEAR Installer (version >= 1.8.0), installed version is 1.7.2
downloading PEAR-1.9.4.tgz ...
Starting to download PEAR-1.9.4.tgz (296,332 bytes)
.............................................................done: 296,332 bytes

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used   any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-7.0/DST' instead in PEAR\Validate.php on line 489
downloading Archive_Tar-1.3.9.tgz ...
Starting to download Archive_Tar-1.3.9.tgz (18,123 bytes)
...done: 18,123 bytes

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-7.0/DST' instead in PEAR\Validate.php on line 489
downloading Structures_Graph-1.0.4.tgz ...
Starting to download Structures_Graph-1.0.4.tgz (30,318 bytes)
...done: 30,318 bytes

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-7.0/DST' instead in PEAR\Validate.php on line 489
downloading XML_Util-1.2.1.tgz ...
Starting to download XML_Util-1.2.1.tgz (17,729 bytes)
...done: 17,729 bytes

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-7.0/DST' instead in PEAR\Validate.php on line 489

Warning: require_once(Structures/Graph.php): failed to open stream: No such file or directory in PEAR\Download er.php on line 1230

Warning: require_once(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-7.0/DST' instead in PEAR\Downloader.php on line 1230

但它不会升级。当我重新运行 pear 版本时,它显示我仍在 1.7.2 上。我该如何解决这个问题?

【问题讨论】:

  • 不确定这是否是问题,但要摆脱警告,您可以在 php.ini 文件中添加时区。 php.net/manual/en/datetime.configuration.php。也许尝试一下,看看 PEAR 是否正确下载。
  • 看起来主要错误是这个虽然Warning: require_once(Structures/Graph.php): failed to open stream: No such file or directory in PEAR\Download er.php on line 1230

标签: php phpunit pear zend-server


【解决方案1】:
  1. 从 pear.php.net 网站下载并解压缩 Structures_Graph。 (Direct Link) 注意:?可能想要获得比您当前版本更旧的版本 安装 PEAR,虽然我对最新版本没有任何问题 (1.0.4) 运行 PEAR 1.8.0

  2. 将文件夹/文件移动到位 如果您不知道该文件夹的移动位置,请执行以下操作: cmdline> pear config-show 查找“PEAR”的路径 目录 php_dir",即你的 PEAR\lib 文件夹

“Structures”文件夹 -> 移入“PEAR\lib”文件夹

其余的可以删除,因为它们会在您实际创建时创建 安装 Structures_Graph,但仅供参考:“许可证”-> 删除或 将其移动到“PEAR”根目录,或 docs 或任何“docs”文件夹 -> 删除或 移入“PEAR\docs”文件夹“tests”文件夹-> 删除移入 “PEAR\tests”文件夹“package.xml”-> 删除,以及任何其他包 文件

  1. 安装“Structures_Graph”,尽管文件存在,但尚未真正安装 Structures_Graph。命令行>梨-a install Structures_Graph 这将安装最新版本 您配置的频道(例如 pear.php.net) -a 参数将 也安装任何依赖包

  2. 将您的 PEAR 安装升级到当前版本 cmdline> pear upgrade PEAR

  3. 升级包 Console_GetOpt。可能还没有正确安装 cmdline> pear upgrade Console_Getopt

参考资料:

http://www.sencha.com/forum/archive/index.php/t-120958.html

Can't install PEAR on Windows 7, Structures/Graph error

【讨论】:

  • 我的 Pear 目录在这里...C:\Program Files (x86)\Zend\ZendServer\bin\PEAR\pear。我把结构文件放在里面。 Ran pear install -a Structures_Graph 但它试图从网上提取 tar 文件,我收到以下错误:ERROR: unable to unpack C:\Program Files (x86)\Zend\ZendServer\bin\PEAR\tmp\Structures_Graph-1.0.4.tgz
  • 有没有办法告诉它抓取一个forom PEAR\lib
  • 你能在第二步之后试试pear upgrade-all吗(即将结构文件夹复制到pear文件夹)?
  • 我将解压后的 .tgz 文件移动到了临时文件夹中,它成功了!我重新运行 pear upgrade PEAR,它说... pear/PEAR is already installed and is the same as the release version 1.9.4 但是当我执行 pear 版本时,它说版本是 1.9.4。所以它奏效了!谢谢!
猜你喜欢
  • 2011-09-29
  • 2012-07-15
  • 2015-02-21
  • 2012-02-15
  • 2011-09-10
  • 2021-12-15
  • 2011-08-25
相关资源
最近更新 更多