Reputation: 561
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.
Upvotes: 1
Views: 2888
Reputation: 1
The solution for me was realising the the previous line needed a comma, even though it caught a different error. However, your post is older, and it may have been a newer bug for me:
{
"<random junk>":"path/to/junk",
"<more junk>":"path/to/other-junk"
"php.validate.executablePath":"usr/bin/php"
}
note that the second last line is missing a comma at the end. For me, I saw this immidately, but VSCode ran a different error saying it couldn't validate (which makes sense because it can't identify the error properly as it can't lint php).
Upvotes: -1
Reputation: 561
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.
Upvotes: 3