Created
October 4, 2012 11:39
-
-
Save dajoho/3833091 to your computer and use it in GitHub Desktop.
Install PHPCS OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo cp /private/etc/php.ini.default /private/etc/php.ini; | |
sudo php /usr/lib/php/install-pear-nozlib.phar; | |
pear config-set php_ini /private/etc/php.ini; | |
pecl config-set php_ini /private/etc/php.ini; | |
sudo pear upgrade-all; | |
sudo pear install PHP_CodeSniffer; | |
---- | |
nano /private/etc/php.ini; | |
include_path Zeile einkommentieren & umändern in: | |
include_path = ".:/php/includes:/usr/lib/php/pear/" | |
---- | |
cd ~/Sites/myproject; | |
phpcs index.php; |
In my case PEAR is under /usr/share/pear/
So in my php.ini
i have include_path = ".:/php/includes:/usr/share/pear"
On recent versions of OS X, /etc is symlinked into /private/etc.
I was able to just run
sudo pear upgrade-all and sudo pear install PHP_CodeSniffer
and now it "just works"
localhost $ phpcs --version
PHP_CodeSniffer version 1.5.5 (stable) by Squiz (http://www.squiz.net)
Worked like a charm in MacBook Pro - Yosemite, thank you. R6.
I will add to change permissions over php.ini to be able to write.
@shadelotus command worked like a charm in El Capitan 👍
Worked like a charm in Yosemite
Awesome!
I'm on Sierra and I had to manually symlink phpcs to the phpcs bin in my Homebrew cellar (even though I installed PHP_CodeSniffer via PEAR, my PHP install was through Homebrew)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when you say: nano /private/etc/php.ini;
the real file should be the one in /etc/, not en /private: nano /etc/php.ini;