2012-09-07 245 views
7

我嘗試安裝軟件包from pear.phpqatools.org/phpqatoolsPEAR包安裝失敗

首先命令pear config-get php_dir回報D:\Users\xampp\php\pear 和我沒有權限來安裝C驅動器上。

然後根據從http://phpqatools.org/ 說明我進入:

pear config-set auto_discover 1 
pear install pear.phpqatools.org/phpqatools 

我也試圖進入: pear install --alldeps pear.phpqatools.org/phpqatools

但所有這些嘗試的結果是失敗...

這是一個日誌:

Package "pear.phpqatools.org/phpqatools" dependency "pear.phpunit.de/PHPUnit" has no releases 
Unknown remote channel: pear.pdepend.org 
Unknown remote channel: pear.phpmd.org 
Unknown remote channel: components.ez.no 
Package "pear.phpunit.de/PHPUnit_SkeletonGenerator" dependency "pear.phpunit.de/Text_Template" has 
no releases 
Package "pear.phpunit.de/phpcpd" dependency "pear.phpunit.de/File_Iterator" has no releases 
Package "pear.phpunit.de/phpcpd" dependency "pear.phpunit.de/PHP_Timer" has no releases 
Unknown remote channel: components.ez.no 
Package "pear.phpunit.de/phploc" dependency "pear.phpunit.de/File_Iterator" has no releases 
Unknown remote channel: components.ez.no 
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.phpunit.de/File_Iterator" has no rel 
eases 
Failed to download pear/Text_Highlighter within preferred state "stable", latest release is version 
0.7.3, stability "beta", use "channel://pear.php.net/Text_Highlighter-0.7.3" to install 
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.phpunit.de/PHPUnit" has no releases 
Package "pear.phpqatools.org/PHP_CodeBrowser" dependency "pear.php.net/PhpDocumentor" has no releas 
es 
Package "pear.php.net/PHP_CodeSniffer" dependency "pear.phpunit.de/PHP_Timer" has no releases 
Package "pear.phpunit.de/DbUnit" dependency "pear.phpunit.de/PHPUnit" has no releases 
Package "pear.phpunit.de/DbUnit" dependency "pear.symfony-project.com/YAML" has no releases 
WARNING: "pear/DB" is deprecated in favor of "pear/MDB2" 
WARNING: "pear/Auth_SASL" is deprecated in favor of "pear/Auth_SASL2" 
phpqatools/phpqatools requires package "channel://pear.pdepend.org/PHP_Depend" 
phpqatools/phpqatools requires package "channel://pear.phpmd.org/PHP_PMD" 
phpunit/PHPUnit_SkeletonGenerator requires package "channel://components.ez.no/ConsoleTools" (versi 
on >= 1.6) 
phpunit/phpcpd requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) 
phpunit/phploc requires package "channel://components.ez.no/ConsoleTools" (version >= 1.6) 
phpunit/phploc can optionally use PHP extension "bytekit" 
phpqatools/PHP_CodeBrowser can optionally use package "pear/Text_Highlighter" (version >= 0.7.1) 
downloading PHP_CodeBrowser-1.0.3.tgz ... 
Starting to download PHP_CodeBrowser-1.0.3.tgz (172,253 bytes) 
.....................................done: 172,253 bytes 
downloading PHP_CodeSniffer-1.3.6.tgz ... 
Starting to download PHP_CodeSniffer-1.3.6.tgz (352,931 bytes) 
...done: 352,931 bytes 
downloading DbUnit-1.1.2.tgz ... 
Starting to download DbUnit-1.1.2.tgz (41,895 bytes) 
...done: 41,895 bytes 
downloading Console_CommandLine-1.1.3.tgz ... 
Starting to download Console_CommandLine-1.1.3.tgz (38,507 bytes) 
...done: 38,507 bytes 
downloading Log-1.12.7.tgz ... 
Starting to download Log-1.12.7.tgz (46,898 bytes) 
...done: 46,898 bytes 
downloading DB-1.7.14.tgz ... 
Starting to download DB-1.7.14.tgz (133,103 bytes) 
...done: 133,103 bytes 
downloading MDB2-2.4.1.tgz ... 
Starting to download MDB2-2.4.1.tgz (119,790 bytes) 
...done: 119,790 bytes 
downloading Mail-1.2.0.tgz ... 
Starting to download Mail-1.2.0.tgz (23,214 bytes) 
...done: 23,214 bytes 
downloading Net_SMTP-1.6.1.tgz ... 
Starting to download Net_SMTP-1.6.1.tgz (13,164 bytes) 
...done: 13,164 bytes 
ERROR: failed to mkdir C:\php\pear\tests\PHP_CodeSniffer\CodeSniffer\Core\File 
ERROR: failed to mkdir C:\php\pear\docs\DbUnit\Samples\BankAccountDB\_files 
ERROR: failed to mkdir C:\php\pear\data\Console_CommandLine\data 
ERROR: failed to mkdir C:\php\pear\docs\Log\docs 
ERROR: failed to mkdir C:\php\pear\docs\DB\doc 
ERROR: failed to mkdir C:\php\pear\docs\MDB2\docs\examples 
ERROR: failed to mkdir C:\php\pear\tests\Mail\tests 
ERROR: failed to mkdir C:\php\pear\docs\Net_SMTP\docs 
ERROR: failed to mkdir C:\php\pear\data\PHP_CodeBrowser\templates\css 

我不明白爲什麼安裝嘗試mkdir在C:\php\pear\以及如何解決與未知刪除渠道的問題...

+4

我通過手動刪除PEAR的高速緩存(位於解決了類似的(但不相同)的問題:'C:\ Users \ \ AppData \ Local \ Temp \ pear')。 – yannis

回答

10

我發現讓梨的工作時使用XAMP是不刪除該文件夾,並從頭開始重新安裝它的唯一途徑。梨客戶端(很長一段時間非常非常破碎的1.9.2版本)即使在例外的位置也不能正常工作,但當你在其他地方安裝xamp時,沒有一種合理的方法來解決它,因爲路徑設置的方式到很多文件。

按照上http://pear.php.net/manual/en/installation.getting.php指導。

下載http://pear.php.net/go-pear.phar,執行它,選擇system廣泛安裝和適應所有路徑到您的位置。

一旦工作和pear version報告1.9.4使用

pear config-set auto_discover 1 
pear install --force --alldeps pear.phpqatools.org/phpqatools 

「修復」任何舊的安裝遺留下來的。


只使用該版本的梨應該修復所有的包和通道故障。

它吧,出於某種原因,不使用

pear channel-discover $everyChannelThatDoesNotWork 
pear channel-update $thatChannel 

對於被報告爲問題的一切。

+0

更新沒有工作,但完全刪除梨,並從頭開始安裝 - 是的。 –

+0

哇哇謝謝!這是安裝這些永無止境的qa軟件包的最簡單方法。最佳答案。 – stefgosselin

+1

使用 - 強制盧克!爲我工作。謝謝! –

1

梨配置不正確。我記得XAMPP安裝的梨沒有開箱即用。

有關如何正確設置所需變量的指導,請參閱here。找到設置爲默認值的文件,如C:\php\<something>,並將其更改爲XAMPP pear/php安裝中的文件夾。

+0

'pear config-set'不會更改任何變量,我嘗試... –

+0

您可能需要手動更改配置文件。 另請參閱[此答案](http://stackoverflow.com/a/8246271/925231)。 – Ivo

5

請更正下列命令配置路徑:

pear config-show 

pear config-create/C:\xampp\php\pear.ini 

pear -c c:\xampp\php\pear.ini config-set doc_dir c:\xampp\php\pear\docs 
pear -c c:\xampp\php\pear.ini config-set bin_dir c:\xampp\php 
pear -c c:\xampp\php\pear.ini config-set ext_dir c:\xampp\php\ext 
pear -c c:\xampp\php\pear.ini config-set php_dir c:\xampp\php\pear 
pear -c c:\xampp\php\pear.ini config-set cache_dir c:\xampp\php\cache 
pear -c c:\xampp\php\pear.ini config-set cfg_dir c:\xampp\php\cfg 
pear -c c:\xampp\php\pear.ini config-set data_dir c:\xampp\php\data 
pear -c c:\xampp\php\pear.ini config-set download_dir c:\xampp\php\download 
pear -c c:\xampp\php\pear.ini config-set php_bin c:\xampp\php\php.exe 
pear -c c:\xampp\php\pear.ini config-set temp_dir c:\xampp\php\tmp 
pear -c c:\xampp\php\pear.ini config-set test_dir c:\xampp\php\pear\tests 
pear -c c:\xampp\php\pear.ini config-set www_dir c:\xampp\php\pear\www 

pear -c c:\xampp\php\pear.ini config-show 

每個梨命令應使用-c c:\xampp\php\pear.ini參數,例如:

pear -c c:\xampp\php\pear.ini config-set auto_discover 1 
pear -c c:\xampp\php\pear.ini install pear.phpqatools.org/phpqatools 
3

無需手動刪除PEAR緩存

pear clear-cache 

清除梨緩存而不必搜索ca che手動。

這解決了響應試圖下載從中

no release for package .... 

它向我表示鴨梨有針對已經被記錄爲特定的軟件包沒有新版本的結構通道包時,我得到在我的系統上,雖然沒有成功安裝。

利用穩定的同時改變最佳狀態到devel的

pear config-set preferred_state devel 

所有我需要的軟件包,其中大部分是要麼devel的或α-

希望這可以幫助別人浪費的允許安裝將近一天的時間,這讓我越來越覺得爲什麼我得到了「無版本」響應。

7

如果像這對我來說,運行的所有梨配置設定的命令仍然導致該錯誤:

failed to mkdir C:\php\pear\tests\PHP_CodeSniffer\CodeSniffer\Core\File

則是我花了一段時間才能找出一個簡單的解決方案:

以管理員身份運行您的終端

真的,這就是解決方案。然後,像其他人說:轉到C:\ XAMPP \你的終端PHP和鍵入以下命令:

pear config-set doc_dir C:\xampp\php\pear\docs 
pear config-set cfg_dir C:\xampp\php\pear\cfg 
pear config-set data_dir C:\xampp\php\pear\data 
pear config-set man_dir C:\xampp\php\local\man 
pear config-set test_dir C:\xampp\php\pear\tests 
pear config-set www_dir C:\xampp\php\pear\www 

pear install PHP_CodeSniffer 
+0

乾杯,這在Windows中用CMD工作。 – Leo

+0

@Joery這絕對是問題 – Kevlwig