1

I am trying to setup php in VSCode. I don't want it in my global settings, so in the workspace settings I have:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "php.validate.enable": true,
        "php.validate.executablePath": "C:\\php\\php.exe",
        "php.validate.run": "onType"
    }
}

I downloaded PHP to c:\php...

enter image description here

But am still getting this error when I fire up the workspce:

PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting
0

1 Answer 1

7

You also need to set php.executablePath inside the settings.json, so that everything works as it should.

To find the settings.json file go to;

File -> Preferences -> User Settings -> Settings.json

And in this, make sure the following are set;

"php.executablePath": "C:\\php\\php.exe",
"php.validate.executablePath": "C:\\php\\php.exe"
Sign up to request clarification or add additional context in comments.

7 Comments

This seems more of a comment than an answer?
But it fixed it as I thought. So it is the answer? Or what of the question answer part am I getting wrong? @Sam
@LukeFilewalker - it's not that it doesn't fit as it is now, and to be honest, if I were you, I wouldn't waste the time trying to find MSDN docs even if my life depended on it, I think it could be useful adding example locations of the file mentioned? Maybe adding an example of the relevant data/code in there?
Ok I'll try to improve it a bit later. Its quite hard getting it better from a smartphone...
Thanks @SamSwift for styling my answer!
|

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.