I'm trying to get an installation of phpunit going on my os x Lion with MAMP. I have installed phpunit at /Applications/MAMP/bin/php/php5.4.4/lib/php.
When I run phpunit in the terminal I get this error:
Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:') in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
I noticed that the include path is "." so I ran this in the terminal to find which php.ini file is being loaded "php --ini" and get this
Loaded Configuration File: /Applications/MAMP/bin/php/php5.4.4/conf/php.ini
The include path in the php.ini file is
include_path = ".:/Applications/MAMP/bin/php/php5.4.4/lib/php:/usr/lib/php/pear:/usr/bin/phpunit"
So why does it come out as "." when running phpunit in the terminal?
As a check, I created a php file with this code:
echo get_include_path();
when I run that file in the terminal it outputs the include path in the php.ini file.
I also added echo get_include_path();
to the top of /Applications/MAMP/bin/php/php5.4.4/lib/php/PHPUnit/Autoload.php. When I run phpunit in the terminal with this, the outputed include path is ".:"
It seems like phpunit is loading a different include path which needs to be fixed.