【问题标题】:Can't install PEAR on Windows 7, Structures/Graph error无法在 Windows 7 上安装 PEAR,结构/图形错误
【发布时间】:2011-06-10 16:38:18
【问题描述】:

我刚刚完成了 Windows 7 的全新安装。我已经安装了 Apache、Mysql 和 PHP 5.3.5 全部分开(不使用 XAMPP/其他)。

我在安装过程中遇到以下错误:错误:无法解压 phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/ Structures_Graph-1.0.2.tar

完整的堆栈跟踪是:

C:\Web\php-5.3.5>go-pear.bat

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] : system

Below is a suggested file layout for your new PEAR installation.  To change individual locations, type the number in front of the directory.  Type 'all' to change all of them or simply press Enter to accept these locations.

 1. Installation base ($prefix)                   : C:\Web\php-5.3.5
 2. Temporary directory for processing            : C:\Web\php-5.3.5\tmp
 3. Temporary directory for downloads             : C:\Web\php-5.3.5\tmp
 4. Binaries directory                            : C:\Web\php-5.3.5
 5. PHP code directory ($php_dir)                 : C:\Web\php-5.3.5\pear
 6. Documentation directory                       : C:\Web\php-5.3.5\docs
 7. Data directory                                : C:\Web\php-5.3.5\data
 8. User-modifiable configuration files directory : C:\Web\php-5.3.5\cfg
 9. Public Web Files directory                    : C:\Web\php-5.3.5\www
10. Tests directory                               : C:\Web\php-5.3.5\tests
11. Name of configuration file                    : C:\Web\php-5.3.5\pear.ini
12. Path to CLI php.exe                           : C:\Web\php-5.3.5

1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\Web\php-5.3.5\pear.ini...
Initialized registry...
Preparing to install...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3.3.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-1.2.3.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.8.0.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar...
installing phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.3
install ok: channel://pear.php.net/Console_Getopt-1.2.3
ERROR: unable to unpack phar://C:/Web/php-5.3.5/PEAR/go-pear.phar/PEAR/go-pear-tarballs/Structures_Graph-1.0.2.tar
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.8.0
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"

** WARNING! Old version found at C:\Web\php-5.3.5, please remove it or be sure t
o use the new c:\web\php-5.3.5\pear.bat command

The 'pear' command is now at your service at c:\web\php-5.3.5\pear.bat

* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\Web\php-5.3.5\PEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

C:\Web\php-5.3.5>

【问题讨论】:

  • 你能告诉我为什么投票否决吗?
  • 别担心,我会解决的 ;-)

标签: windows-7 installation pear


【解决方案1】:

经过几天的谷歌搜索,我找到了答案。就这个。 How to solve:

具有管理员权限(以管理员权限启动cmd):

  1. 运行默认 PHP 安装附带的 go-pear.bat。它将安装 PEAR,但在安装 Structures_Graph 时会产生错误。 IMO Pear 需要这个包来生成包依赖关系(图),因为它缺少它不允许我们安装或升级任何其他包。

  2. 从 pear.php.net 网站 (direct link) 下载并解压缩 Structures_Graph。然后将Structure 文件夹复制到PEAR 文件夹中。存档包含三个文件夹:docs、Structures、tests。我们只需要结构之一。将 Structures 文件夹复制到您的 PHP_ROOT_DIRECTORY\PEAR 目录。所以如果你在C:\Web\php-5.3.5上安装了PHP,将Structures文件夹复制到C:\Web\php-5.3.5\PEAR\,结果应该是:C:\Web\php-5.3.5\PEAR\Structures

  3. pear install Structures_Graph。即使文件存在,Structures_Graph 并没有真正安装(我们在安装过程中遇到了问题)。所以我们需要运行上面的命令。

  4. pear upgrade PEAR。这会将 PEAR 本身升级到当前版本。

  5. pear upgrade Console_Getopt。这会将 Console_Getopt 升级到当前版本,现在我们可以管理和安装任何 pear 包。

【讨论】:

  • 说明 1 和 2 帮助了我,但我仍然无法升级它。感谢您让我走上正轨。
  • 解决了,在前两个步骤之后我运行 pear upgrade-all 强制 pear 到最新版本。
  • 刚刚遇到这个问题,它对我有用。谢谢!希望他们能解决这个问题。
  • 非常感谢。您为我节省了数小时的故障排除时间。我像 Neil 一样复制了 Structures 文件后进行了 pear upgrade-all 并且它起作用了。仅供参考,您需要以管理员权限运行命令行,以便能够创建目录。
  • 只是一些注意事项,以使其他人免于按照上述说明操作的麻烦: 1. 在第 2 步中,必须将结构复制到的目录对我来说是 PEAR\pear(这是已经在下面的另一个答案中提到过) 2. 当我尝试第 3 步时,我总是收到无法解压缩 Structures_Graph-1.0.4.tgz 文件的消息。经过多次尝试和错误,我删除了 PEAR\tmp 文件夹中的所有内容,PEAR 临时下载包的地方,它工作了。
【解决方案2】:

Marcos Roriz 解决方案确实有效,但要澄清第 2 点:

未压缩的“Structures”文件夹(在 tgz 中)需要放在文件夹中:“PEAR\pear” -> 例如C:\wamp\bin\php\php5.3.5\PEAR\pear

【讨论】:

    【解决方案3】:

    这是您需要做的事情和一些新调整的组合。使用 WAMP(Wampserver 2.2.1)在 WinXP Pro 上工作

    更改您的go-pear.bat 文件:

    @ECHO OFF
    set PHP_BIN=php.exe
    %PHP_BIN% -d output_buffering=0 -d phar.require_hash=0 PEAR\go-pear.phar
    pause
    

    运行它 - go-pear.bat

    现在您已经安装了缺少 graph.php 的 Pear

    从 pear.php.net 网站下载并解压缩 Structures_Graph。将 Structure 文件夹复制到 PEAR 文件夹中,以便密钥文件如下所示:

    PEAR\Structures\Graph.php
    PEAR\Structures\Graph\Node.php
    

    在 Node.php 中更改这一行:

    require_once '/Structures/Graph.php';
    

    在PEAR目录中执行:

    pear upgrade=all
    

    这对我有用。

    【讨论】:

    • 你成就了我的一天。在我的 Zend 安装中,这是唯一可行的解​​决方案。
    【解决方案4】:

    首先,以管理员身份运行。

    然后 - 尝试在控制台的目标目录中写入一些内容以隔离任何剩余的权限问题。

    【讨论】:

    • 您是否尝试过运行控制台并在目标目录中写入任何文件? (PEAR istaller 正在尝试解压缩存档)?
    【解决方案5】:

    在升级我的 wampserver 后,我遇到了很多问题,它现在带有 php 5.3.5。

    我已经通过安装 php 5.3.0 并使用它来运行在http://pear.php.net/go-pear 找到的安装程序解决了这个问题。我将php cli设置设置为php5.3.5文件夹没有任何问题。

    这可能是 wampserver 特定的。为了衡量您是否遇到类似的问题,以下是我遇到的一些问题:

    使用 php5.3.5 打包的 go-pear.bat 我遇到了与原始海报相同的无法解包错误。

    使用 php5.3.0 打包的 go-pear.bat 我能够完成安装,但 pear 安装程序是 v1.8.0

    使用前面提到的 pear 站点上的安装程序和 php5.3.5 我遇到了一个错误“警告:rmdir(D:\temp): Directory not empty in D:\go-pear.php on line 1237”。查看堆栈跟踪,Archive_Tar 类抛出错误,安装程序无法自行清理。

    【讨论】:

      【解决方案6】:

      Web 前端没有向 pear.ini 写入正确的路径 ig phph 设置为 magic_quotes_gpc = On
      它在“\”的路径中将所有斜杠“\”加倍,这是一个错误吗? 例如,可以将包解包(路径错误?)

      安装包时出现“无法解包”消息

      http://pear.php.net/bugs/bug.php?id=18212

      【讨论】:

        【解决方案7】:

        我尝试了以上所有方法都没有运气。下载并解压“Structures”文件夹后,我必须编辑所有路径并添加“PEAR/”。然后我能够执行“pear install Structures_Graph”,然后执行“pear upgrade-all”

        图形.php

        require_once 'PEAR/Structures/Graph/Node.php';
        

        Node.php

        require_once 'PEAR/Structures/Graph.php';
        

        AcyclicTest.php

        require_once 'PEAR/Structures/Graph.php';
        require_once 'PEAR/Structures/Graph/Node.php';
        

        TopologicalSorter.php

        require_once 'PEAR/Structures/Graph.php';
        require_once 'PEAR/Structures/Graph/Node.php';
        require_once 'PEAR/Structures/Graph/Manipulator/AcyclicTest.php';
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-06-27
          • 1970-01-01
          • 2011-02-23
          • 2017-01-30
          • 2012-02-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多