4

I installed the PHP Intellisense extension and followed the instructions to point VSCode to my php file, I also setup the environmental; variable in windows to point to the php directory.

When I open VSCode I get the following error:

PHP executable not found. You need PHP 7 installed and in your PATH

VSCode Settings:

enter image description here

Environmental Variables:

enter image description here

How can I get this to work?

I have referred to:

2
  • Did you try forward slashes in the VS executablePath like "C://path.to.your.php.folder//php.exe"? Commented Apr 5, 2017 at 21:07
  • @j08691 Yeah, same deal Commented Apr 9, 2017 at 3:07

3 Answers 3

1

You need to click on "Path" and highlight it in the list of System variables and then click the Edit button. A new window with a list of paths in the environmental variable will open. Click the New button on the top right and type or paste your copied path to PHP.exe there. It should work then.

Sign up to request clarification or add additional context in comments.

Comments

1

You have to append php path to the Path variable.
Click on "Path" select edit
click the red color marked item
Do not modify the values, just insert semicolon(;) to the end of the values, then paste(append) "C:\xampp\php" to end of the Path value
Then save settings. You may need to restart your machine

Comments

0

I faced same issue, I did exactly as your case but still got the error, the below solution worked for me.

I had changed the .EXE PHP file to: php-win.exe and that's it, the VS settings should like that (according to my path):

"php.validate.executablePath": "D:\\Program Files (x86)\\PHP\\php\\php-win.exe",
"php.executablePath": "D:\\Program Files (x86)\\PHP\\php\\php-win.exe"

VS PHP Path

Comments

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.