phpcs.executablePath not work on Windows 10
See original GitHub issuei tryed
"phpcs.executablePath": "C:/Users/user/bin/PHP_CodeSniffer/vendor/bin/phpcs.bat"
and this
"phpcs.executablePath": "C:\\Users\\user\\bin\\PHP_CodeSniffer\\vendor\\bin\\phpcs.bat"
- from command line - it work
- from vscode 1.20.1 - not work
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Visual Studio Code: Unable to locate phpcs - Stack Overflow
Didn't work on my Windows 10 i had to add phpcs at the end like the following: C:\Users\{user_name}\AppData\Roaming\Composer\vendor\bin\phpcs. – kuroyza. May 6, ...
Read more >Developers - phpcs.executablePath not work on Windows 10 -
25 February 2018 Posted by whateveruse. i tryed. "phpcs.executablePath": "C:/Users/user/bin/PHP_CodeSniffer/vendor/bin/phpcs.bat". and this. "phpcs.
Read more >[SOLVED] Unable to locate phpcs. Please add ... - Robert Askam
Restart your Visual Studio Code and you should now not get the error: phpcs: Unable to locate phpcs. Please add phpcs to your...
Read more >php-cs-fixer.executable path windows Code Example - Code Grepper
executablePathWindows": "phpcs.bat", "php-cs-fixer.onsave": true, //If you want to ... php.validate.executablepath wamp · why css not working with php file.
Read more >Setting up WordPress Coding Standards in VS Code
It makes your code easier to maintain and read not only for yourself ... Now that we have WPCS and PHPCS in our...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For me it was not working with phpcs installed globally via composer. Although not mentionned, the problem lied in the source of my php executable. I use Ampps (like Xamp/Mamp) for localhosting my php sites and I had to change %userprofile%\AppData\Roaming\Composer\vendor\bin\phpcs.bat to the correct php path. Changed it from:
@ECHO OFF setlocal DISABLEDELAYEDEXPANSION SET BIN_TARGET=%~dp0/…/squizlabs/php_codesniffer/bin/phpcs php “%BIN_TARGET%” %*
To:
@ECHO OFF setlocal DISABLEDELAYEDEXPANSION SET BIN_TARGET=%~dp0/…/squizlabs/php_codesniffer/bin/phpcs “C:\Program Files (x86)\Ampps\php-7.1\php” “%BIN_TARGET%” %*
For reference: in VSCode, in the PHP CodeSniffer settings, this is what I have for my Executable Path: C:/Users/MYUSERNAME/AppData/Roaming/Composer/vendor/bin/phpcs.bat
all works i have problem if php not installed globally i made fixed script https://github.com/rivetweb/PHP_CodeSniffer/blob/bitrix/phpcs.bat and replace vendor/bin/phpcs.bat