douli0531 2013-04-17 08:52
浏览 102
已采纳

安装pear时如何修复错误以安装phpunit?

I am not quite sure if the question belongs to this forum, so if not and you are about to close this question, please make a suggestion where else to ask this question.

Basically, I need to install phpunit on Ubuntu 12.04. By doing so with the packet manager I get an error when running phpunit:

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

for which there are solutions, i.e. to install phpunit with pear.

Following the pear install instructions I download and run go-pear.phar, which itself produces an error

PHP Notice:  Uninitialized string offset: 0 in phar:///home/alexander/opt/src/go-pear.phar/Console/Getopt.php on line 145

Any suggestions how to proceed from here? I also ONLY need phpunit, so pear will be used just for this case once.

  • 写回答

2条回答 默认 最新

  • douyanguo7964 2013-04-17 09:33
    关注

    The installation of phpunit really seems to be extremly complicated and circumstantial, but here is the solution:

    • As for Ubuntu 12.04 pear should be already installed
    • However, the latest version of pear should be used
    • And phpunit need to be removed before it is reinstalled

    The whole procedure and each step is described on symfony-world, one might need the additional step shown in the given comment. Here is a copy-and-paste of the complete procedure for Ubuntu 12.04:

    sudo apt-get remove phpunit
    sudo apt-get upgrade pear
    sudo pear channel-discover pear.phpunit.de
    sudo pear channel-discover pear.symfony-project.com
    sudo pear channel-discover components.ez.no
    sudo pear channel-discover pear.symfony.com
    sudo pear update-channels
    sudo pear upgrade-all
    sudo pear install --alldeps phpunit/PHPUnit
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示