Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installed on Windows sublime 3 - Not working #178

Open
oakbani opened this issue Jul 27, 2017 · 5 comments
Open

Installed on Windows sublime 3 - Not working #178

oakbani opened this issue Jul 27, 2017 · 5 comments

Comments

@oakbani
Copy link

oakbani commented Jul 27, 2017

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

@MrKarlDilkington
Copy link

I am experiencing the same issue.

@benmatselby
Copy link
Owner

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.

@Micu22
Copy link

Micu22 commented Nov 22, 2020

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

@benmatselby
Copy link
Owner

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.

@oakbani
Copy link
Author

oakbani commented Oct 15, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants
@benmatselby @MrKarlDilkington @oakbani @Micu22 and others