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

时间:2011-01-17 20:29:45

标签: windows-7 install pear

我刚刚安装了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>

7 个答案:

答案 0 :(得分:41)

经过几天的谷歌搜索,我找到了答案。就这个。 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升级到当前版本,现在我们可以管理和安装任何梨包。

答案 1 :(得分:5)

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

未压缩的“Structures”文件夹(在tgz中)需要放在文件夹中:“PEAR \ pear” - >例如C:\瓦帕\ BIN \ PHP中\ php5.3.5 \ PEAR \梨

答案 2 :(得分:4)

这是您需要做的事情和一些新的调整的组合。使用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

这是为我做的。

答案 3 :(得分:1)

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

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

答案 4 :(得分:1)

升级我的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,我能够完成安装,但梨安装程序是v1.8.0

使用php5.3.5之前提到的梨网站上的安装程序我出错了"警告:rmdir(D:\ temp):1237行的D:\ go-pear.php中的目录不为空&# 34 ;.查看堆栈跟踪,Archive_Tar类抛出错误,安装程序无法自行清理。

答案 5 :(得分:1)

网络前端没有写到pear.ini的正确路径 ig phph设置为magic_quotes_gpc = On
它的双打全部斜线“\”在“\”的路径中它是一个错误吗? 例如,包可以解包(错误的路径?)

“无法解压缩”安装包时的消息

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

答案 6 :(得分:1)

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

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';
相关问题