1

I've installed PHPCS via pear, and all the instructions say that if everything goes right running PHPCS -i should return something. But they never say what to do when it doesn't work. This was working a few months ago, and now does not.

jlesc@CATODCSWKSTN1 C:\MAMP\bin\php\php7.0.0
$ pear install PHP_CodeSniffer
downloading PHP_CodeSniffer-2.9.1.tgz ...
Starting to download PHP_CodeSniffer-2.9.1.tgz (526,111 bytes)
.........................................................................................................done: 526,111 bytes
install ok: channel://pear.php.net/PHP_CodeSniffer-2.9.1

jlesc@CATODCSWKSTN1 C:\MAMP\bin\php\php7.0.0
$ phpcs -i

jlesc@CATODCSWKSTN1 C:\MAMP\bin\php\php7.0.0
$

Stumped at what the issue is?

When I uninstall it removes the command as expected.

jlesc@CATODCSWKSTN1 C:\MAMP\htdocs
$ pear uninstall php_codesniffer
uninstall ok: channel://pear.php.net/PHP_CodeSniffer-2.9.1

jlesc@CATODCSWKSTN1 C:\MAMP\htdocs
$ phpcs
'phpcs' is not recognized as an internal or external command,
operable program or batch file.

So what would make the command recognized, but produce no output?

Picard102
  • 624
  • 1
  • 9
  • 21
  • Have you tried using PHPCS to test a file and confirm it is working and installed correctly? I've tested the `-i` option and it is working fine on my PEAR-installed version of 2.9.1, so I wonder if you have a bigger issue with the install. – Greg Sherwood May 25 '17 at 22:56
  • @GregSherwood Same result, blank. – Picard102 May 26 '17 at 13:57
  • Sounds a lot like you've got error reporting disabled or something like that. If PHPCS isn't doing anything, it's going to be because it can't include a file based on your php.ini include path. But without an sort of error message, there isn't any real way for me to know what is going on. Id' just check that PEAR is installed correctly, and your `php.ini` has the PEAR `php_dir` setting in the include path. View the path using `pear config-show` and look for php_dir. Then make sure `php.ini` has that in `include_path`. – Greg Sherwood May 27 '17 at 10:37
  • If nothing works, you might want to try running the phar file or from a git clone. Instructions are here: https://github.com/squizlabs/PHP_CodeSniffer#installation – Greg Sherwood May 27 '17 at 10:38

0 Answers0