3

There are multiple other posts reporting this, but they are related to javascript frameworks, etc.

I get this error when opening any .php extension file and the error pops up at the top and it always blocks the tabs, very annoying.

enter image description here

Similar posts, but does not solve:

Sakura Kinomoto
  • 1,784
  • 2
  • 21
  • 30
user3108268
  • 1,043
  • 3
  • 18
  • 37

2 Answers2

4

check your config file (F1 + config and select settings json) and search for:

"php.validate.executablePath": null,

I have the same error and it was because I have pointing to the wrong file:

"php.validate.executablePath": "C:\\xampp\\php\\php.ini"

it must point to (in my case):

"php.validate.executablePath": "C:\\xampp\\php\\php.exe",

example

JUAN CALVOPINA M
  • 3,695
  • 2
  • 21
  • 37
2

I encountered the same issue today. If someone is using Ubuntu and XAMPP then your path is /opt/lampp/bin/php. I was using /opt/lampp/php therefore VSCode was showing Error spawning PHP: spawn EACCES error as soon as my files were loading in the editor.

Either you are using XAMPP or have installed PHP alone on Ubuntu Linux, you can always run whereis php in your terminal to locate php path.

The problem has also been discussed here https://github.com/felixfbecker/vscode-php-intellisense/issues/25

I hope this helps developers!