Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...