1

I have a question about Visual Studio Code and phpcs extension. I'm working in Ubuntu and I run in to problem, that VSCode could not start phpcs. It throws error: "/usr/bin/env: 'php': No such file or directory". I tried to run "vendor/bin/phpcs --version" from VSCode terminal and got same error. In same time "php -v" did work just fine. Then I tried to run same code in linux terminal and both commands worked there. After searching for solution I found solution, where suggested changing first line of phpcs file from "/usr/bin/env php" to direct php file location. And now all works. But it looks like a dirty way of fixing this issue. So, my question, is there any better solution for this problem?

1 Answer 1

1

Add

{
   "php.executablePath": "/path/to/PHP/bin"
}

to VS Code's settings.json

Sign up to request clarification or add additional context in comments.

1 Comment

VSCode says, that it's unknown configuration setting. I have this "php.validate.executablePath", but that does not help either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.