簡體   English   中英

無法在Windows 7上安裝PEAR,結構/圖形錯誤

[英]Can't install PEAR on Windows 7, Structures/Graph error

我剛剛完成了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>

經過幾天的谷歌搜索,我找到了答案。 就這個。 如何解決

使用管理員權限 (使用管理員權限啟動cmd):

  1. 運行默認PHP安裝附帶的go-pear.bat 它將安裝PEAR,但在安裝Structures_Graph時會產生錯誤。 IMO Pear需要這個包來生成包依賴(圖形),因為它缺少它不允許我們安裝或升級任何其他包。

  2. 從pear.php.net網站下載並解壓縮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包。

Marcos Roriz解決方案確實有效,但澄清第2點:

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

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

這樣做對我來說。

首先,以管理員身份運行。

然后 - 嘗試在控制台的目標目錄中寫入一些內容,以隔離任何剩余的權限問題。

我升級了我的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

使用php5.3.5之前提到的pear站點上的安裝程序我有一個錯誤“警告:rmdir(D:\\ temp):D37上的目錄不為空:在第1237行的go-pear.php”。 查看堆棧跟蹤,Archive_Tar類拋出錯誤,安裝程序無法自行清理。

web前端沒有寫到pear.ini的正確路徑ig phph設置是magic_quotes_gpc = On
它的雙打全部斜線“\\”在“\\”的路徑中它是一個錯誤嗎? 例如,包可以解壓縮(錯誤的路徑?)

安裝包時“無法解壓縮”消息

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

我沒有運氣就嘗試了以上所有方法。 下載並解壓縮“Structures”文件夾后,我必須編輯所有路徑並添加“PEAR /”。 然后我能夠做“梨安裝Structures_Graph”然后“梨升級全部”

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM