PHPUnit,PEAR升级错误 [英] PHPUnit , PEAR upgrading Errors
问题描述
注意:我已阅读有关此问题的所有问题
在我的系统上安装并配置了PEAR(Ubuntu 11.10 + Apache/2.2.20).因为
PEAR is installed and configured on my system (Ubuntu 11.10 + Apache/2.2.20). Because
<?php
require_once 'System.php';
var_dump(class_exists('System', false));
?>
返回此:
bool(true)
当我尝试使用phpunit时,出现此错误.
When i tried to use phpunit i'm getting this error.
PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38
PHP Fatal error: require_once(): Failed opening required 'PHP/CodeCoverage/Filter.php' (include_path='.:/usr/share/php:/usr/share/pear') in /usr/bin/phpunit on line 38
出现此错误后,我决定安装它
After this error i've decided to install it
sudo /usr/bin/pear install phpunit/PHP_CodeCoverage
但是我得到
phpunit/PHP_CodeCoverage requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2
用sudo pear upgrade
PHP Fatal error: Call to undefined method PEAR_Registry::packageinfo() in /usr/share/php/PEAR/Dependency2.php on line 687
我不确定是什么问题?
附加
(command
:result
)
/usr/bin/pear config-get php_dir
:/usr/share/php
Configuration File (php.ini) Path (on phpinfo();)
:/etc/php5/apache2
php -c /etc/php5/apache2/php.ini -r 'echo get_include_path()."\n";'
:.:/usr/share/php
pear upgrade pear
:PHP Fatal error: Call to undefined method PEAR_Registry::packageinfo() in /usr/share/php/PEAR/Dependency2.php on line 687
PEAR版本:1.9.2和php-pear
软件包已安装.
PEAR Version : 1.9.2 and php-pear
package installed.
推荐答案
PEAR 1.9.2已过时,并且无法通过较新的pear服务器基础结构进行修复.
PEAR 1.9.2 is outdated and broken beyond any hope of repair with newer pear server infrastructure.
我不知道为什么发行版仍然坚持一些刚刚被破坏的东西:)
I have no clue why distributions still insist on something that is just broken :)
Install a new pear via go-pear.phar
并进行确保您拥有pear version 1.9.4
,然后强制使用
Install a new pear via go-pear.phar
and make sure you have pear version 1.9.4
and then force pear to ignore it's old cache files using
sudo pear install --force --alldeps phpunit/phpunit
摆脱旧梨子
sudo apt-get purge php5-pear
现在
which pear
应该导致找不到命令.如果仍然存在,请删除/usr/share/php中的二进制文件和相关的php类.
should result in the command not being found. If it is still there delete the binary and the associated php classes in /usr/share/php.
从您的控制台历史记录中,我会说您没有安装具有 sudo
权限的新梨,因此它位于/home/或/usr/local/中,而不是默认目录中系统位置.
From your console history I'd say you didn't install the new pear with sudo
rights so it landed in /home/ or in /usr/local/ instead of in the default system location.
没关系,只要你
- 摆脱旧梨子
- 将您的php.ini include_path更改为新的pear安装位置
这篇关于PHPUnit,PEAR升级错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!