在 pear.phpunit.de/PHPUnit
中安装 PHPUnit
未知 channel pear.phpunit.de
时出错 无效的包名称/包文件 "Debian-4
操作系统上的 pear.phpunit.de/PHPUnit”。
我已按照 http://phpunit.de/manual/3.7/en/installation.html 中的说明进行操作我已经尝试了 PHAR
方法和 PEAR
方法,但都没有用。
这是服务器设置:
PEAR Version: 1.9.4
PHP Version: 5.4.4-14+deb7u3
Zend Engine Version: 2.4.0
Running on: Linux lsh1001 3.9.6-hw+ #6 SMP
当我尝试使用 PEAR
方法安装时,我运行:
pear config-set auto_discover 1
我收到了
config-set succeeded
但是,当我运行
pear install pear.phpunit.de/PHPUnit
我收到:
Attempting to discover channel "pear.phpunit.de"...
downloading channel.xml ...
Starting to download channel.xml (804 bytes)
....done: 804 bytes
Auto-discovered channel "pear.phpunit.de", alias "pear.phpunit.de", adding to registry
unknown channel "pear.phpunit.de" in "pear.phpunit.de/PHPUnit"
invalid package name/package file "pear.phpunit.de/PHPUnit"
install failed
我刚开始使用命令行提示符,所以我可能会做一些奇怪的事情。我尝试在代码行前加上 sudo,但我收到:
-bash: sudo: command not found
当我这样做的时候。
我希望能够使用浏览器前端而不是命令行安装来运行 PHPUnit
。我也尝试了 PHAR
安装方法,但我不确定如何指向已安装的 phpunit.phar
文件。我可以直接从命令行运行 phpunit.phar
文件,但如何在我的 php.ini
文件中引用它?我已将该文件留在我的根目录中并且没有移动它。
最佳答案
试试这个命令流程
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
并且...如果您是 root
,请忽略 sudo
引用 PHPUnit Site
关于php - 安装 PHPUnit 'unknown channel "时出错 pear.phpunit.de"in "pear.phpunit.de/PHPUnit"',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18603825/