Search code examples
phpvisual-studio-codelinux-mint

Visual Studio Code not recognising PHP on Linux


So I've set the "php.validate.executablePath" to "/usr/bin/php" in the user settings but keep getting this message

Cannot validate since /usr/bin/php is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.

additional info:

lrwxrwxrwx 1 root root 21 Jul 25 12:26 /usr/bin/php -> /etc/alternatives/php

lrwxrwxrwx 1 root root 15 Jul 25 12:26 /etc/alternatives/php -> /usr/bin/php7.2

-rwxr-xr-x 1 root root 4895768 Jul 4 18:55 /usr/bin/php7.2

I've installed PHP via apt-get and I'm out of ideas. Anyone with a tipp or the same problem here?

Edit: I've also tried setting php.validate.executablePath to /etc/alternatives/php and /usr/bin/php7.2 which spawned the same message (just with the different paths). Logging off and on again did nothing also.


Solution

  • Since no one had an explanation, I uninstalled Visual Studio Code and purged php via apt-get and reinstalled both, first PHP, then Visual Studio Code. This time I took the package from the Microsoft page and not the Version form mintinstall. Now it seems to work.