Apache-2.2

使用 PEAR Installer (Windows) 安裝 PHPUnit 時遇到問題

  • June 21, 2011

我正在嘗試安裝phpunit/PHPUnit. 我得到類似下面的東西,我認為問題是Archive/Tar.php沒有找到?我嘗試使用--alldeps開關並得到同樣的錯誤。嘗試安裝pear install archive_tar甚至會在Archive/Tar.php未找到的地方出現相同的錯誤!

D:\ResourceLibrary\Frameworks>pear install phpunit/PHPUnit
phpunit/PHPUnit can optionally use PHP extension "dbus"
downloading PHPUnit-3.5.5.tgz ...
Starting to download PHPUnit-3.5.5.tgz (116,148 bytes)
.........................done: 116,148 bytes

Warning: require_once(Archive/Tar.php): failed to open stream: No such file or directory in PEAR\PackageFile.php on line
303

Warning: require_once(Archive/Tar.php): failed to open stream: No such file or directory in C:\Program Files (x86)\PHP\p
ear\PEAR\PackageFile.php on line 303

Call Stack:
   0.0051     531000   1. {main}() C:\Program Files (x86)\PHP\pear\pearcmd.php:0
   0.3031    3490920   2. PEAR_Command_Common->run() C:\Program Files (x86)\PHP\pear\pearcmd.php:305
   0.3031    3490920   3. PEAR_Command_Install->doInstall() C:\Program Files (x86)\PHP\pear\PEAR\Command\Common.php:271

   0.3672    5387880   4. PEAR_Downloader->download() C:\Program Files (x86)\PHP\pear\PEAR\Command\Install.php:661
  62.4850    8482968   5. PEAR_Downloader_Package->download() C:\Program Files (x86)\PHP\pear\PEAR\Downloader.php:453
  62.4906    8488512   6. PEAR_Downloader_Package->_fromUrl() C:\Program Files (x86)\PHP\pear\PEAR\Downloader\Package.p
hp:263
  63.1216    8490512   7. PEAR_PackageFile->fromAnyFile() C:\Program Files (x86)\PHP\pear\PEAR\Downloader\Package.php:1
622
  63.1226    8490616   8. PEAR_PackageFile->fromTgzFile() C:\Program Files (x86)\PHP\pear\PEAR\PackageFile.php:483


Fatal error: require_once(): Failed opening required 'Archive/Tar.php' (include_path='C:\Program Files (x86)\PHP\pear')
in C:\Program Files (x86)\PHP\pear\PEAR\PackageFile.php on line 303

Call Stack:
   0.0051     531000   1. {main}() C:\Program Files (x86)\PHP\pear\pearcmd.php:0
   0.3031    3490920   2. PEAR_Command_Common->run() C:\Program Files (x86)\PHP\pear\pearcmd.php:305
   0.3031    3490920   3. PEAR_Command_Install->doInstall() C:\Program Files (x86)\PHP\pear\PEAR\Command\Common.php:271

   0.3672    5387880   4. PEAR_Downloader->download() C:\Program Files (x86)\PHP\pear\PEAR\Command\Install.php:661
  62.4850    8482968   5. PEAR_Downloader_Package->download() C:\Program Files (x86)\PHP\pear\PEAR\Downloader.php:453
  62.4906    8488512   6. PEAR_Downloader_Package->_fromUrl() C:\Program Files (x86)\PHP\pear\PEAR\Downloader\Package.p
hp:263
  63.1216    8490512   7. PEAR_PackageFile->fromAnyFile() C:\Program Files (x86)\PHP\pear\PEAR\Downloader\Package.php:1
622
  63.1226    8490616   8. PEAR_PackageFile->fromTgzFile() C:\Program Files (x86)\PHP\pear\PEAR\PackageFile.php:483

D:\ResourceLibrary\Frameworks>

更新:我應該說它在 Windows 上,我在 Ubuntu 上安裝沒有問題

我通過重新安裝 PEAR 解決了這個問題,我認為 Archive_Tar 應該與 PEAR 一起安裝

引用自:https://serverfault.com/questions/213136