2009-09-19 83 views
7

Possible Duplicate:
Installing PHPUnit via PEAR不能通過梨安裝PHPUnit

的安裝PHPUnit的指令運行以下命令:

pear channel-discover pear.phpunit.de 
pear install phpunit/PHPUnit 

第一個進入還好,第二我得到一個錯誤:

phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed version is 1.7.2 
phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (version >= 1.2.1) 
phpunit/PHPUnit can optionally use package "pear/Log" 
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5) 
No valid packages found 
install failed 

我剛剛從php.net(php 5.3.0) 同時使用最新的go-pear.phar版本安裝了梨也嘗試運行php go-pear.php as pear web網站說。

運行pear -V給我的版本1.7.2,當我運行pear upgrade PEAR它說我的版本比當前NOE這是1.9.0更新,如果跑pear upgrade -f PEAR給力的升級,它下載的文件和成功,但我安裝還有版本1.7.2,不能安裝phpunit。

我運行Windows Vista,PHP 5.3.0

回答

7

,我發現我的解決方案( 'cweiske' 在irc.efnet.nl #pear) -

  1. 我刪除其居住我的梨文件夾在:

    C:\Program Files\Zend\ZendServer\bin

  2. 設置PHP include_path到:

    C:\Program Files\Zend\ZendServer\bin\pear

  3. 得到go-pear.php來自:

    http://pear.php.net/go-pear

    文件另​​存爲go-pear.php,我保存到C:\Program Files\Zend\ZendServer\bin

  4. 運行php go-pear.php設置PHP代碼目錄,以相同include_path

    C:\Program Files\Zend\ZendServer\bin\pear

和一切正常

我正在運行1.9.0。

+0

恭喜你。 :) – Till 2009-09-19 14:46:00

12

嘗試類型控制檯:

pear upgrade pear 
+0

啊哈!這個命令在PEAR安裝指南中很奇怪。 – Rudu 2010-10-25 21:20:19

2

如果你有升級或安裝過程中的問題,你可以使用:

peardev upgrade PEAR 
peardev channel-discover pear.phpunit.de 
peardev install phpunit/PHPUnit 

它爲我工作;我有Windows 7 64x + WAMP。