首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法在Windows 7上安装PEAR,结构/图形错误

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

Stack Overflow用户
提问于 2011-01-18 04:29:45
回答 6查看 12.4K关注 0票数 17

我刚刚完成了Windows7的全新安装,我已经安装了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

完整的堆栈跟踪是:

代码语言:javascript
复制
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>
EN

回答 6

Stack Overflow用户

发布于 2011-02-04 00:44:52

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

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

票数 5
EN

Stack Overflow用户

发布于 2011-06-22 22:35:31

这是你需要做的事情和一些新的调整的组合。使用WAMP (Wampserver2.2.1)处理WinXP专业版

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

代码语言:javascript
复制
@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文件夹中,以便密钥文件的位置如下:

代码语言:javascript
复制
PEAR\Structures\Graph.php
PEAR\Structures\Graph\Node.php

在Node.php中更改以下行:

代码语言:javascript
复制
require_once '/Structures/Graph.php';

在PEAR目录中执行:

代码语言:javascript
复制
pear upgrade=all

这对我来说就够了。

票数 4
EN

Stack Overflow用户

发布于 2011-01-21 19:31:13

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4717547

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档