问题描述
我正在运行Windows 10新鲜副本,并且我刚刚安装了Visual Studio代码.我试图使用VS Code开发一个PHP项目.但是我在设置环境时遇到了麻烦.
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.
我看到了一篇博客文章,我下载了PHP 7的二进制文件并将其放在"C"驱动器中.然后我也设置路径变量.
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.
推荐答案
您安装了PHP IntelliSense
扩展名,并且由于此错误.
因此,如果您想解决此问题,请转到以下菜单:File -> Preferences -> Settings
现在您可以看到2个窗口.在右侧窗口中添加以下代码:
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"
}
就像下面的图片一样.
注意:此地址C:\\wamp64\\bin\\php\\php7.0.4\\php.exe
是我的php7.exe
文件地址.将该地址替换为自己的php7.exe
.
Just like below image.
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
.
这篇关于找不到PHP可执行文件.安装PHP 7并将其添加到您的PATH或设置php.executablePath设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!