Reputation: 43
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:
$ 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.codecept
file in /Applications/MAMP/bin/php/php5.3.6/bin/
but there isn't - there is however a Codeception
folder in /Applications/MAMP/bin/php/php5.3.6/lib/php
codecept
file in /usr/bin/
as well as the Codeception
folder in /usr/lib/php/pear/
/Applications/MAMP/bin/php/php5.3.6/bin/php
/Applications/MAMP/bin/php/php5.3.6/bin/pear
/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
Upvotes: 4
Views: 2231
Reputation: 1
One solution that worked for me was to edit /Applications/MAMP/bin/php5.3/bin/codecept and replace /usr/bin/php at the first line by /Applications/MAMP/bin/php5.3/bin/php
Upvotes: 0
Reputation: 314
I think the problem is: your PEAR command was executed from bundled PHP. So your primary MAMP PHP libraries in (/Applications/MAMP/bin/php/php5.3.6/bin/pear)
were not updated. I suggest you should find the second PEAR were the Codeception was exctually stored. And add path to it into 'include_path' in php.ini.
Yes, PEAR is quite buggy. In next releases a Composer installator will be added.
Also, you can try to use Phar executable.
In this case a Codeception should be executed with:
php codecept.phar
Upvotes: 3