ObliviousHarmony / vscode-php-codesniffer

A VS Code extension for integrating PHP_CodeSniffer.
https://marketplace.visualstudio.com/items?itemName=obliviousharmony.vscode-php-codesniffer
Other
38 stars 2 forks source link

The PHPCS worker encountered an error: `env: php: No such file or directory` #54

Closed danielpost closed 1 year ago

danielpost commented 1 year ago

Description

I'm not sure if this is something in my local config, but I'm suddenly getting the following error: The PHPCS worker encountered an error.. When checking the extension output, it says env: php: No such file or directory.

I've tried a couple things:

$ php -v
PHP 8.0.25 (cli) (built: Nov  3 2022 09:27:45) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.25, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.25, Copyright (c), by Zend Technologies
$ which php
/opt/homebrew/bin/php

I also tried setting "php.debug.executablePath": "/opt/homebrew/bin/php" in settings.json but that didn't work either.

Reproduction Steps

  1. Open a PHP file in VS Code.
  2. See the error.

Expected Behavior

PHPCS would work as expected without the error.

Screenshot 2022-11-10 at 13 28 25@2x Screenshot 2022-11-10 at 13 28 31@2x
danielpost commented 1 year ago

Some updates on my local config seem to have fixed it, sorry for the noise!

ObliviousHarmony commented 1 year ago

Thanks @danielpost, I'm glad to have helped by procrastinating! The joys of parental leave and being a new parent 😃

Have a good week!