问题描述
我正在运行 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
扩展,因此出现此错误.
因此,如果您想解决此问题,请转到此菜单:
文件 ->首选项 ->设置
现在你可以看到 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 设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!