Tuesday 4 February 2014

PHP CLI config on Mac

Quick post following a bit of frustration this morning.  I had an issue with phpmd and phpcs not being able to find my pear libs.


Warning: include_once(PHP/CodeSniffer/CLI.php): failed to open stream: No such file or directory in /usr/bin/phpcs on line 31 Warning: include_once(): Failed opening 'PHP/CodeSniffer/CLI.php' for inclusion (include_path='.:') in /usr/bin/phpcs on line 31 Fatal error: Class 'PHP_CodeSniffer_CLI' not found in /usr/bin/phpcs on line 34 Warning: require_once(PHP/PMD/TextUI/Command.php): failed to open stream: No such file or directory in /usr/bin/phpmd on line 45 Fatal error: require_once(): Failed opening required 'PHP/PMD/TextUI/Command.php' (include_path='.:') in /usr/bin/phpmd on line 45

This was because there is no php cli config file by default (in mavericks at least). Linking the existing php.ini.default to php.ini resolves this issue.

sudo ln -s /etc/php.ini.default /etc/php.ini

No comments:

Post a Comment