How to set php executable path php.validate.executablePath in vscode when php is set inside docker container?

Here is a screenshot.

  • Don't forget to escape \
  • You don't have to add it to the Path

set php.validate.executablePath snapshot


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


In my case using XAMPP is like this

"php.validate.executablePath": "C:/xampp/php/php.exe"

hope that answer your question