I am trying to install php code sniffer. I have manage to get to a point where after running
php /Users/ryanfernandes/pear/bin/phpcs --version
it display the info. but when I try to run code sniffer by
php /Users/username/pear/bin/phpcs /Users/username/development/htdocs/test.php
PHP Warning: fwrite() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 155
Warning: fwrite() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 155
PHP Warning: stream_get_meta_data() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 206
Warning: stream_get_meta_data() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 206
PHP Warning: file_get_contents(): Filename cannot be empty in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 208
Warning: file_get_contents(): Filename cannot be empty in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 208
PHP Warning: fclose() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 209
Warning: fclose() expects parameter 1 to be resource, boolean given in /Users/username/pear/share/pear/PHP/CodeSniffer/Reporting.php on line 209
Any help would be really appreciated.
Thanks
From the error messages, it looks like you are using PHP_CodeSniffer version 1.5.4. PHP_CodeSniffer uses the tmpfile() function to create a temporary file. The directory that it is created in can be found by running:
Make sure you are allowed to write to that directory because the tmpfile() method is obviously returning FALSE, which most commonly happens if the directory is not writable.