【问题标题】:VSCode: PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath settingVSCode:未找到 PHP 可执行文件。安装 PHP 7 并将其添加到您的 PATH 或设置 php.executablePath 设置
【发布时间】:2019-09-11 17:56:14
【问题描述】:

朋友们! 在尝试为 VS 代码编辑器 v1.37.1 安装 PHP IntelliSense v2.3.10 后,我收到此错误(见标题)。我没有安装 PHP。我使用已激活 PHP7.1-x64 支持的 Open Server v5.3.0 Ultimate。

这里看起来和我的情况不太一样。 PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

而且我看不到将PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting 中提到的两行放在哪里的窗口。

请告诉我该怎么做。

【问题讨论】:

  • :-? ...你的意思是this

标签: php visual-studio-code


【解决方案1】:

很容易解决。 首先你需要找到你的php可执行文件所在的位置,它叫做php.exe

例如我正在使用 laragon :E:/laragon/bin/php/php-7.2.19-Win32-VC15-x64/php.exe

所以你需要做的就是找到这个位置,然后去file=>preferences=>settings并搜索settings.json 然后打开它并添加这一行

"php.validate.executablePath": "your php .exe path" 当然你需要仔细添加这一行并遵守 json 格式规则

【讨论】:

  • 如果我的电脑上没有 php.exe 怎么办?我使用 Open Server 作为 localhost。
  • @Mikhail 如果您没有安装 PHP,那么您将无法使用此扩展。它的marketplace page 声明:“语言服务器 [...] 完全用 PHP 实现”。另外,如果您没有可用的语言编译器/解释器,那么用任何给定语言开发代码都是很奇怪的。
猜你喜欢
  • 2017-03-10
  • 1970-01-01
  • 2017-08-31
  • 1970-01-01
  • 1970-01-01
  • 2011-11-03
  • 1970-01-01
  • 1970-01-01
  • 2020-05-23
相关资源
最近更新 更多