Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

visual studio code - PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

I'm running windows 10 fresh copy and I just installed visual studio code. I was trying to develop a PHP project using VS Code. But I'm having trouble in setting up the environment.

I saw a blog post and I downloaded the binary file of PHP 7 and place it in the "C" drive. Then I set path variable too.

But still, I'm getting this issue.

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You installed PHP IntelliSense extension, and this error because of it.
So if you want to fix this problem go to this menu:
File -> Preferences -> Settings
Now you can see 2 window. In the right window add below codes:

{
    "php.validate.executablePath": "C:\wamp64\bin\php\php7.0.4\php.exe",
    "php.executablePath": "C:\wamp64\bin\php\php7.0.4\php.exe"
}

Just like below image.

enter image description here

NOTICE: This address C:\wamp64\bin\php\php7.0.4\php.exe is my php7.exe file address. Replace this address with own php7.exe.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...