-1

I installed the PHP Server extension for VS Code and added two lines to settings.json:

"php.validate.executablePath": "С://php-server//php.exe",
"phpserver.phpPath": "С://php-server//php.exe"

I inserted these lines before the closing bracket ("}") and added a comma on the previous to last line.

I restarted VS Code and got the message:

Unable to validate because h:\web\php\с:\php-server\php.exe is not a valid PHP executable. Use the php.validate.executablePath parameter to configure the PHP executable.

No matter what I tried, it still looks for php.exe on the disk with the device letter "h".

8
  • 1
    Windows Paths use backslashes. To escape a backslash you need also a backslash, so you have to double them. Commented yesterday
  • 1
    Please write how the address should look like according to yours. Commented yesterday
  • 2
    @MarkusZeller: Windows use slashes or backslashes, DOS/CPM paths use backslashes only - just for clarification. I've also spotted the duplication on the slashes and therefore would suggest - as not clear what VSCode does there, to fall-back to the DOS/CPM paths with backslashes. To give the example for the JSON strings: "С:\\php-server\\php.exe". This may not yet change the outcome but to make your question more clear you should show both tries. Double check it, then edit with the update @Andrianovi. Commented yesterday
  • 2
    And sorry to "spam" the comments here: Per the documentation, for windows the path with single slashes as directory separators - here the link: code.visualstudio.com/docs/languages/php#_windows Commented yesterday
  • 2
    Furthermore: If what I could gather is true so far, then my educated guess is that it was either the double-slashes "//" (which should not be an issue when resolving the path - but who knows?) or the setting is not taken into account at all (so the h:/... value in the message is just some default). I'd recommend you start with Linting as it is easier to verify than the webserver: code.visualstudio.com/docs/languages/php - and when it works the webserver is also easier to setup. Just my 2 cents. Commented yesterday

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.