benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
812 stars 126 forks source link

Correct path - OSError: [Errno 13] #109

Closed josephzidell closed 10 years ago

josephzidell commented 10 years ago

I'm getting OSError: [Errno 13] Permission denied, but my path is correct (Using Ubuntu 12.04):

    "phpcs_executable_path": "/usr/bin/phpcs",

that path works in the terminal.

Any ideas?

benmatselby commented 10 years ago

Can you paste in the debug from the console please (you will need to turn debug on first). I assume you do have permission to that path and that the path is valid?

josephzidell commented 10 years ago

Here is the output & yes I do have permission to the path and it is valid:

Traceback (most recent call last):
  File "./sublime_plugin.py", line 362, in run_
  File "./phpcs.py", line 565, in run
  File "./phpcs.py", line 401, in run
  File "./phpcs.py", line 132, in get_errors
  File "./phpcs.py", line 358, in execute
  File "./phpcs.py", line 361, in parse_report
  File "./phpcs.py", line 162, in shell_out
  File ".\subprocess.py", line 633, in __init__
  File ".\subprocess.py", line 1139, in _execute_child
OSError: [Errno 13] Permission denied
benmatselby commented 10 years ago

Can you copy/paste the few line above that, so I can see the command that is being shelled out to the terminal please?

benmatselby commented 10 years ago

Also, are you using home brew installation of phpcs?

josephzidell commented 10 years ago

The only think above that is the previous OSError, nothing else.

I used PEAR to install phpcs, am on Ubuntu 12.04.

benmatselby commented 10 years ago

Is the following option true, in your user settings:

"show_debug": true,

If so, it would print in the console the shelled out command. As of now, this doesn't look related to the plugin, rather the config of the underlying commands being used.

josephzidell commented 10 years ago

Your last comment helped in an around-about way. When I changed show_debug to true, I saw the command being executed and it was incorrect. That was because I misunderstood the instructions for phpcs_php_path: "cannot always find the php application". I thought that meant my php app, while it really meant the PHP executable. Fixed and now works! Thanks :+1: