Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Include path problems installing PEAR/PHPUnit

I'm following this http://www.newmediacampaigns.com/page/install-pear-phpunit-xdebug-on-macosx-snow-leopard to install PEAR/PHPUnit. I'm having trouble with the include paths.

Some background info:

Farooqs-MacBook-Pro:bin fyousuf$ which php
/usr/bin/php

Farooqs-MacBook-Pro:bin fyousuf$ which pear
/usr/local/bin/pear

Farooqs-MacBook-Pro:bin fyousuf$ which phpunit
/usr/local/bin/phpunit

I think the part where I'm messing up is "Update PHP include path" in the link I posted above.

This is what is in my php.ini file:

    ; UNIX: "/path1:/path2"
    ;include_path = ".:/php/includes"
    include_path = ”/usr/local/bin/PEAR:/php/includes”
    ;
    ; Windows: "\path1;\path2"
    ;include_path = ".;c:\php\includes"
    include_path = ”/usr/local/bin/PEAR:/php/includes”
    ;
    ; PHP's default setting for include_path is ".;/path/to/php/pear"
    ; http://php.net/include-path`

When I try to run a Selenium test using phpunit I get this error:

   phpunit functions.php

   PHP Warning:  require_once(File/Iterator/Autoload.php): failed to open stream: No such            
   file or directory in /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 64
   PHP Fatal error:  require_once(): Failed opening required 'File/Iterator/Autoload.php'         
   (include_path='”/usr/local/bin/PEAR:/php/includes”') in       
   /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 64

New Edits:

I have PHPUnit installed:

Farooqs-MacBook-Pro:echo360-5.0 fyousuf$ sudo pear install phpunit/PHPUnit phpunit/PHPUnit is already installed and is the same as the released version 3.7.27 install failed

But when I type phpunit in terminal I get the same error as before:

PHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 64 PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/usr/local/PEAR:/php/includes') in /usr/local/pear/share/pear/PHPUnit/Autoload.php on line 64

like image 508
Farooq Avatar asked Sep 30 '13 21:09

Farooq


1 Answers

The error message states that PHPUnit is located in this pear directory:

/usr/local/pear/share/pear/PHPUnit

This should transform into this path to be added to the include_path setting:

/usr/local/pear/share/pear

You currently defined /usr/local/bin/PEAR, which looks weird. Especially since the install directions state that it should be /usr/local/PEAR, but this depends on how PEAR was actually installed.

like image 76
Sven Avatar answered Oct 14 '22 20:10

Sven