Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working with Ubuntu 11.10 as root on my local machine, I've installed xampp 1.7.7 and

While following a tutorial on sitepoint on how to install pear to use PhpUnit, I didn't notice it then, but it seems that I installed or used an existing php version 5.3.6 in CL to do that, also the pear installation was built on this version, while xampp being installed,I now have two versions of php,xampp's 5.3.8 and the 5.3.6, anyway, what I want to do is to use the existing xampp php version and build pear on that, to make all my work through xampp.so my questions are:

  1. How to uninstall the php V5.3.6 and it's pear installation?
  2. How to link the CL with the php ver. Of xampp?
  3. How to build the next pear installation on the php ver. Of xampp?
  4. I want all my web dev. Work through xampp, is there anything else I need to unistall, to avoid this confusion? 4.

I did the following in attampet to solve the problem:

  1. I wrote this in bash:

    gedit ~/.bashrc

  2. I added that to the end of ~/.bashrc file in attempt to change environment path:

    export PATH=/opt/lampp/bin:$PATH export PATH=/opt/lampp/lib/php:$PATH export PATH=/opt/lampp/lib/php/PHPUnit/pearcmd.php:$PATH

  3. I checked the php and pear version using 'php -v' and 'pear list'. I got an ouput of:

    PHP 5.3.8 (cli) (built: Sep 19 2011 13:29:27) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

and for pear:

Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.9   stable
Console_Getopt   1.3.1   stable
PEAR             1.9.4   stable
PHPUnit          1.3.2   stable
Structures_Graph 1.0.4   stable
XML_Util         1.2.1   stable
  1. When I run: 'phpunit MessageTest.php': I get

    PHP Warning: require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 38

    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='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38

  2. I ran the following commands as reported in other questions as a solution to that error:

    sudo apt-get remove phpunit sudo pear channel-discover pear.phpunit.de sudo pear channel-discover pear.symfony-project.com sudo pear channel-discover components.ez.no sudo pear update-channels sudo pear upgrade-all sudo pear install --alldeps phpunit/PHPUnit sudo apt-get install phpunit

and updated include path of php.ini to be:

include_path = ".:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR"

the php file MessageTest.php:

<?php
  require 'PHPUnit/Autoload.php';
  $path = '/opt/lampp/lib/php/PEAR';
  set_include_path(get_include_path() . PATH_SEPARATOR . $path);

  require_once 'PHPUnit/Framework/TestCase.php';
  require_once 'Message/Controller/MessageController.php';

  class MessageTest extends PHPUnit_Framework_TestCase{
    private $message;
    public function setUp() {
      $this->message = new MessageController();
    }
    public function tearDown() {
    } 
    public function testRepeat(){
      $yell = "Hello, Any One Out There?";  
      $this->message->repeat($yell); //sending a request
      $returnedMessage = $this->message->repeat($yell);//get a response
      $this->assertEquals($returnedMessage, $yell);
    }  
  }
?>

MessageController class from MessageController.php that i'm trying to test

<?php

  class MessageController { 
    public function actionHelloWorld() {
      echo 'helloWorld';  
    }
    public function repeat($inputString){
      return $inputString;
    }
  }
  $msg = new MessageController;
?>

I'm not using any PHP framework, I just made the files and classes sounds like it that's all.

And still I get the same error:

PHP Warning:  require_once(PHP/CodeCoverage/Filter.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line

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='.:/php/includes:/opt/lampp/lib/php:/opt/lampp/bin:/opt/lampp/lib/php/PEAR') in /usr/bin/phpunit on line 38

Sure, I'm getting demanding here, I've wasted a lot of time and got really frustrated over this, hope you guys don't get bored reading through my questions, I appreciate your help

share|improve this question
    
what does find / -iname phpunit say? –  Sathya Apr 6 '12 at 6:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.