I have a development environment based in docker.
Everytime that I open VSCode I get this message:
Cannot validate since no PHP executable is set.
"php.validate.executablePath": "C:/php/php.exe"
wont work due to incorect escaping
try this;
"php.validate.executablePath": "C:\\php\\php.exe"
I also got this error message. The path to php.exe
was already set in my System Environment Variables.
The error went away when I commented out "php.validate.executablePath": "c:/path/to/php7.2.10/php.exe"
, in the settings.json
file in VSCode.
Here is a screenshot.
\
IF using Laragon...Dont forget to change \ to /
"php.executablePath": "C:/laragon/bin/php/php-7.4.5-Win32-vc15-x64/php.exe",
In my case using XAMPP is like this
"php.validate.executablePath": "C:/xampp/php/php.exe"
hope that answer your question
I don't know if this helps but I ran into the same problem with the extension PHP Intelephense in Visual Studio Code. What I did is read the instructions so the extension could work properly. So I disabled PHP Language Features by searching "@builtin PHP" in the extensions. Also, other (3rd party) PHP extensions that provide similar functionality should also be disabled for best results. Finally, I added glob patterns for non-standard PHP file extensions to the files.associations setting. For example: "files.associations": { "*.module": "PHP" }
Doing this made the error go away. I'm new to PHP too, let me know if this is the correct way of solving this problem with PHP Intelephense.