Hi,
The `"php.version"" setting is the preferred way. It can be set per-workspace (per-project), per-machine, or even per-user. (https://docs.devsense.com/en/vscode/php-version). The version is used by the editor and you should see the confirmation in VS Code's status bar:
The editor and the debugger should pick this PHP you have specified her BUT PHP Tools are checking all the PHP's that
are specified everywhere just for errors - so it will notify if you have any PHP specified within your VS Code wrong.
launch.json:
We do support "php.executablePath"
setting as well, also you can set an array of executables to choose from in your project using "php.version"
(https://docs.devsense.com/en/vscode/php-version#custom-php-paths).
In debug launch.json
, it is possible to refer to a PHP version (using "phpVersion": "8.0"
https://docs.devsense.com/en/vscode/debug/launch-json#php-version) or using "runtimeExecutable"
as well.
- with
"phpVersion"
you can specify either a version of PHP, and debugger will find the PHP executable according to this version, or you can use a name specified in the setting "php.executables"
.
- with
"runtimeExecutable"
you specify directly the php executable path.
By default, you don't have to specify anything and the debugger will pick the PHP used by the editor (above).
I hope it helps. If there is a more specific warning, may I ask for the screenshot of the actual problem so we can help in more details.
Thanks!
Jakub