Running:
- MAMP 2.0.5
- PHP 5.3.6 (bundled with MAMP)
- Mac OS X Lion 10.7.2
My goal is to get the Codeception testing framework to work and use within my MAMP project. I'm following the instructions here on how to install it.
Pear is installed and working fine. I am able to get Codeception installed with these commands:
$ pear channel-discover codeception.com/pear
$ pear install codeception/Codeception
Once installed when I try to run the codecept commands I get the following error:
Warning: require_once(Codeception/autoload.php): failed to open stream: No such file or directory in /usr/bin/codecept on line 12
Fatal error: require_once(): Failed opening required 'Codeception/autoload.php' (include_path='.:') in /usr/bin/codecept on line 12
I think that the issue is caused by either:
- A conflict between MAMP's PHP installation in the one bundled with OS X
- An issue with the include_path in my php.ini or somewhere else
Also of interest
- When I run the
$ phpunit
command from inside my project folder I get-bash: phpunit: command not found
but if I run it as$ /Applications/MAMP/bin/php/php5.3.6/bin/phpu nit
it works just fine. - I would expect there to be a
codecept
file in/Applications/MAMP/bin/php/php5.3.6/bin/
but there isn't - there is however aCodeception
folder in/Applications/MAMP/bin/php/php5.3.6/lib/php
- I've tried a few different ways to install it, and I guess one of the ways installed Codeception in Lion's copy of php (as opposed to MAMP's) - so I do have a
codecept
file in/usr/bin/
as well as theCodeception
folder in/usr/lib/php/pear/
For reference:
- PHP lives here:
/Applications/MAMP/bin/php/php5.3.6/bin/php
- Pear lives here:
/Applications/MAMP/bin/php/php5.3.6/bin/pear
- PHPUnit lives here:
/Applications/MAMP/bin/php/php5.3.6/bin/phpunit
Any Help? Suggestions?
Thanks to Davert's help - I was able to confirm that this is a conflict with MAMP's copy of PHP and Lion's built-in copy of PHP. To solve the issue I created a new php.ini
file in /etc
that was a duplicate of php.ini.default
and changed the include_path
to /Applications/MAMP/bin/php/php5.3.6/lib/php