- Step 1 - Download it.
- Install it, the instructions are on the download page.
- Make it globally accessible in your PATH.
- In your System Environment Variables make sure Composer is in your PATH.
- i.e. C:\ProgramData\ComposerSetup\bin;
PHPDownload PHP 7 and save to C:\php7
PEARUsing Git Bash:
Now open Windows Command Prompt as an Administrator
#Download the go-pear using CURL
curl -OL http://pear.php.net/go-pear.phar
As it states at the end of the install instruction, install Reg edits.
pear install PHP_CodeSniffer
PHPCSClose all Command Prompts and open a new one with Admin Rights
composer global require "squizlabs/php_codesniffer=*"
Visual Studio CodeRestart your Visual Studio Code and you should now not get the error:
phpcs: Unable to locate phpcs. Please add phpcs to your global path or use composer dependency manager to install it in your project locally.
Find a PHP file and incorrectly format it and it should now alert you.
The language server needs at least PHP 7 installed. Version found:
Add C:\php7 to System Environment PATH
File->Preferences->Settings->Add "php.validate.executablePath": "C:\\php7\\php.exe"
The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true.
;extension_dir = "ext"
extension_dir = "ext"