If you have recently upgraded to Mac OS X Mountain Lion (10.8) you may find that PHPUnit and other PEAR packages no longer work. You may get errors similar to the following.
PHP Copy & Paste Detector
Warning: require(PHPCPD/Autoload.php): failed to open stream: No such file or directory in /Users/chris/pear/bin/phpcpd on line 49 Fatal error: require(): Failed opening required 'PHPCPD/Autoload.php' (include_path='.:') in /Users/chris/pear/bin/phpcpd on line 49
PHP Mess Detector
Warning: require_once(PHP/PMD/TextUI/Command.php): failed to open stream: No such file or directory in /Users/chris/pear/bin/phpmd on line 38 Fatal error: require_once(): Failed opening required 'PHP/PMD/TextUI/Command.php' (include_path='.:') in /Users/chris/pear/bin/phpmd on line 38
Unfortunately, there doesn’t seem to be an easy way to fix them, other then by reinstalling each package.
sudo pear install --force --alldeps phpunit/phpunit sudo pear install --force --alldeps phpmd/PHP_PMD
The tools should then run as expected.
Don't have time to check my blog? Get a weekly email with all the new posts. This is my personal blog, so obviously it is 100% spam free.
Tags: mountain lion, os x, pear, PHP, phpcpd, phpmd, phpunit
This entry was posted on Monday, August 6th, 2012 at 10:59 am and is filed under Programming, Tech. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.