I just moved to Visual Studio Code. When working with PHP I get two messages, one for information and one for error:
Cannot validate because there is no PHP executable set. Use the "php.validate.executablePath" setting to configure the PHP executable.
PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting
How can I solve that?
If you don't have the PHP executable in the PATH try modifying this line in your VSCode config (you can open the config with Ctrl+ ,)
First uninstall any PHP extensions you have in VS Code.
For the first message: "php.validate.executablePath" . File/Preferences/settings. Or just Ctrl+ ,(comma).
The left side paste the following lines:
For the route it will depend on where the php folder is. It can be xamp, wamp, against the uncompressed php in c.
for the second mistake
Re-install the php extensions for VSCode the same procedure... paste:
They should clarify that in the path to the PHP executable file you have to use the "/" and not the "\" that is normally used by a windows file system. They have no idea how helpful it is to clarify by emphasizing this.
you should change the line to "php.validate.executablePath": "C:\xampp\php\php.exe"
with double slash you should change the line to "php.validate.executablePath": "C:\xampp\php\php.exe"
with double bar
ttps://www.php.net/manual/en/install.windows.manual.php