sublime-phpcs icon indicating copy to clipboard operation
sublime-phpcs copied to clipboard

Installed on Windows sublime 3 - Not working

Open oakbani opened this issue 8 years ago • 5 comments

Here is the error message on command pallete when I try to sniff some file:

Traceback (most recent call last): File "./python3.3/subprocess.py", line 1104, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 818, in run_ return self.run(edit) File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 661, in run File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 479, in run File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 149, in get_errors File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 231, in execute File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 234, in parse_report File "phpcs in C:\Users\oakbani\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package", line 176, in shell_out File "./python3.3/subprocess.py", line 819, in init File "./python3.3/subprocess.py", line 1110, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

oakbani avatar Jul 27 '17 08:07 oakbani

I am experiencing the same issue.

MrKarlDilkington avatar Aug 09 '17 21:08 MrKarlDilkington

Hi @oakbani

I don't have access to a windows machine, which makes supporting this a tad tricky. Could you post the output from the console when debug=true please and also paste in your settings in here please.

benmatselby avatar Aug 10 '17 11:08 benmatselby

I have the same issue. This is not working:

{
	"show_debug": true,
        //phpcs.bat not working, AND phpcs (without .bat) not working
	"phpcs_executable_path": "/c/Users/micha/AppData/Roaming/Composer/vendor/bin/phpcs.bat",
	"phpcs_additional_args": {
		"--standard": "WordPress",
		"-n": ""
	}
}

nor this:

{
	"show_debug": true,
        //phpcs.bat not working, AND phpcs (without .bat) not working
	"phpcs_executable_path": "/Users/micha/AppData/Roaming/Composer/vendor/bin/phpcs",
	"phpcs_additional_args": {
		"--standard": "WordPress",
		"-n": ""
	}
}

Using phpcs from command line works without problems.

Debug info: [Phpcs] /c/Users/micha/AppData/Roaming/Composer/vendor/bin/phpcs.bat --report=checkstyle -n --standard=WordPress C:\Apache24\htdocs\wp-content\themes\mike\404.php [Phpcs] /c/Users/micha/AppData/Roaming/Composer/vendor/bin/phpcs.bat --report=checkstyle -n --standard=WordPress C:\Apache24\htdocs\wp-content\themes\mike\404.php [Phpcs] cwd: C:\Apache24\htdocs\wp-content\themes\mike Traceback (most recent call last): File "./python3.3/subprocess.py", line 1104, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 1088, in run_ return self.run(edit) File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 661, in run File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 479, in run File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 149, in get_errors File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 231, in execute File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 234, in parse_report File "C:\Users\micha\AppData\Roaming\Sublime Text 3\Installed Packages\Phpcs.sublime-package\phpcs.py", line 176, in shell_out File "./python3.3/subprocess.py", line 819, in __init__ File "./python3.3/subprocess.py", line 1110, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified

Micu22 avatar Nov 22 '20 20:11 Micu22

Hey @oakbani @MrKarlDilkington Are you both having this issue still?

Can you confirm that those files exist on your filesystem, and that they have executable permissions? Also, depending on what PHP version you have, you may need to define phpcs_php_prefix_path and phpcs_commands_to_php_prefix.

The comment for those settings are:

  // The path to the php executable.
  // Needed for windows, or anyone who doesn't/can't make phars
  // executable. Avoid setting this if at all possible

and

  // Options include:
  // - Sniffer
  // - Fixer
  // - MessDetector
  // - CodeBeautifier
  //
  // This will prepend the application with the path to php
  // Needed for windows, or anyone who doesn't/can't make phars
  // executable. Avoid setting this if at all possible

This may help.

benmatselby avatar Oct 15 '23 15:10 benmatselby

Can't comment. I haven't tried it for years. And Can't test since I have moved from windows. Thanks

On Sun, 15 Oct 2023, 20:33 Ben Selby, @.***> wrote:

Hey @oakbani https://github.com/oakbani @MrKarlDilkington https://github.com/MrKarlDilkington Are you both having this issue still?

Can you confirm that those files exist on your filesystem, and that they have executable permissions? Also, depending on what PHP version you have, you may need to define phpcs_php_prefix_path and phpcs_commands_to_php_prefix.

The comment for those settings are:

// The path to the php executable. // Needed for windows, or anyone who doesn't/can't make phars // executable. Avoid setting this if at all possible

and

// Options include: // - Sniffer // - Fixer // - MessDetector // - CodeBeautifier // // This will prepend the application with the path to php // Needed for windows, or anyone who doesn't/can't make phars // executable. Avoid setting this if at all possible

This may help.

— Reply to this email directly, view it on GitHub https://github.com/benmatselby/sublime-phpcs/issues/178#issuecomment-1763425641, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADME472NFG35ANFI4BBANKTX7P65JANCNFSM4DUTYFLQ . You are receiving this because you were mentioned.Message ID: @.***>

oakbani avatar Oct 15 '23 16:10 oakbani