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. Use the setting
'php.validate.executablePath' to configure the PHP executable.
Somebody know how to set php.validate.executablePath in this case?
I have no idea how to do it.
Sure, easy. Just follow what it's says.
Go to File> Preferences > Settings ... it will open the settings.json file.
add the following code:
{"php.validate.executablePath": "Here you put your PHP.exe path"}
You have to know where te PHP.exe file is in your computer, search in the php>bin folder.
Hope it works for you
I had the same problem but found the fix here.
In Windows:
- Go To System Properties
- Go To Advanced Tab
- Click "Environment Variables"
- Select Path
- Add a new path that points to your php 7 executable:
For linux users:
if you don't have PHP installed then first download,
then in terminal type
$ whereis php
and it will show path for php executable (It will be either in /usr/bin/php
or usr/local/bin/php
) which you can copy from terminal.
In VScode goto settings.json
file and paste
php.validate.executablePath: /usr/bin/php
"php.validate.executablePath": "C:/php/php.exe"
wont work due to incorect escaping
try this;
"php.validate.executablePath": "C:\\php\\php.exe"
Download PHP, in my case, I downloaded from here:
http://windows.php.net/download/
Copy and paste the files to a location on your computer, and set the path:
"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.