Windows 7 Can';无法在Windows 7上安装PEAR,结构/图形错误

Windows 7 Can';无法在Windows 7上安装PEAR,结构/图形错误,windows-7,installation,pear,Windows 7,Installation,Pear,我刚刚彻底安装了Windows7。我已经安装了Apache,Mysql 和PHP5.3.5都是分开的(不使用XAMPP/others) 我在安装中遇到以下错误:错误:无法解包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-wi

我刚刚彻底安装了Windows7。我已经安装了Apache,Mysql 和PHP5.3.5都是分开的(不使用XAMPP/others)

我在安装中遇到以下错误:错误:无法解包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>

首先,以管理员身份运行


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

升级现在随PHP5.3.5提供的wampserver后,我遇到了许多问题

我已经解决了这个问题,同时安装了PHP5.3.0,并使用它来运行安装程序。我将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):第1237行的D:\go-pear.php中的目录不为空”。查看堆栈跟踪时,Archive_Tar类抛出了一个错误,安装程序无法自行清理。

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

安装软件包时显示“无法解包”消息


经过几天的谷歌搜索,我找到了答案。给你

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

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

  • 从pear.php.net网站()下载并解压缩
    Structures\u Graph
    。然后将
    结构
    文件夹复制到PEAR文件夹中。归档文件有三个文件夹:文档、结构和测试。我们只需要一个。将Structures文件夹复制到
    PHP\u ROOT\u目录\PEAR
    目录。因此,如果您在
    C:\Web\PHP-5.3.5
    上安装了PHP,请将
    Structures
    文件夹复制到
    C:\Web\PHP-5.3.5\PEAR\
    ,结果应该是:
    C:\Web\PHP-5.3.5\PEAR\Structures

  • 不要安装结构图。即使文件存在,也没有真正安装Structures_Graph(我们在安装过程中遇到了问题)。所以我们需要运行上面的命令

  • 执行pear升级pear。这会将PEAR本身升级到当前版本

  • 执行pear升级控制台\u Getopt。这将Console_Getopt升级到当前版本,现在我们可以管理和安装任何pear包


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


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

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

    更改您的
    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网站下载并解压缩结构图。将结构文件夹复制到PEAR文件夹中,以便关键文件位于以下位置:

    PEAR\Structures\Graph.php
    PEAR\Structures\Graph\Node.php
    
    在Node.php中更改此行:

    require_once '/Structures/Graph.php';
    
    在PEAR目录中执行:

    pear upgrade=all
    

    我做到了。

    我尝试了上述所有方法,但都没有成功。下载并解压缩“Structures”文件夹后,我必须编辑所有路径并添加“PEAR/”。然后我可以做“pear安装结构图”和“pear升级所有”

    Graph.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';
    

    你能告诉我为什么投票被否决吗?别担心,我会解决的;-)您是否尝试运行console并在目标目录中写入任何文件?(PEAR isntaller试图解包归档的地方)?说明1和2帮助了我,但我仍然无法升级。谢谢你让我走上正轨。解决了它,在前两个步骤之后,我运行了pear升级,所有这些都迫使pear升级到最新版本。刚刚遇到这个问题,它对我有效。谢谢希望他们能解决这个问题。非常感谢。你帮我省了几个小时的故障排除时间。我在复制完结构文件后做了pear升级,就像Neil做的那样,而且它工作正常。仅供参考,您需要以管理员权限运行命令行,以便它能够创建目录。请注意以下几点,以避免其他人因我试图按照上面的说明操作而遇到麻烦:1。在步骤2中,结构必须复制到的目录是for me PEAR\PEAR(下面的另一个答案中已经提到)2。当我尝试第3步时,我总是得到这样一个消息:它无法解压缩结构图-1.0.4.tgz文件。经过多次尝试和错误后,我删除了PEAR\tmp文件夹中的所有内容,PEAR临时在其中下载软件包,并且成功了。你让我的日子过得很愉快。使用我的Zend安装,这是唯一有效的解决方案。