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

标签 windows-7 installation pear

我刚刚干净安装了Windows7。已经安装了Apache,Mysql
和PHP 5.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>

最佳答案

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

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


运行默认PHP安装随附的go-pear.bat。它会安装PEAR,但是在安装Structures_Graph时会产生错误。 IMO Pear需要此软件包来生成软件包依赖关系(图形),因为缺少它,因此不允许我们安装或升级任何其他软件包。
从pear.php.net网站(direct link)下载并解压缩Structures_Graph。然后将Structure文件夹复制到PEAR文件夹中。归档文件包含三个文件夹:docs,Structures,tests。我们只需要一个结构。将“结构”文件夹复制到您的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
执行pear install Structures_Graph。即使存在文件,也不会真正安装Structures_Graph(在安装过程中出现问题)。所以我们需要运行上面的命令。
执行pear upgrade PEAR。这会将PEAR本身升级到当前版本。
执行pear upgrade Console_Getopt。这会将Console_Getopt升级到当前版本,现在我们可以管理和安装任何pear软件包。

关于windows-7 - 无法在Windows 7上安装PEAR,结构/图形错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4717547/

相关文章:

windows - 如何以编程方式检索区域和语言设置中显示的 "Location"?

javascript - 如何在 Windows 7 中将外部 javascript 调试器与 ie8 一起使用?

java - 如何在 Windows 7 64 位上从 java 应用程序运行 msg.exe(或替代方案)?

Python:如何安装第三方包并使其可供团队其他成员使用

php - 无法安装 pear

c++ - 'GetProcessIdOfThread' : identifier not found

.net - 在 ASP.NET Web 安装项目中,我可以在 IIS 中禁用匿名访问吗?

maven - 跳过 Maven 构建测试的结果是什么?

php - 将旧站点从 DB 更新到 MDB2 连接,出现大量调用未定义函数错误

php - 从 Pear DB 更新到 Pear MDB2 - 开发人员试图在查询中做什么?