dongshuiga2826
2018-05-11 14:01
浏览 566
已采纳

php配置:找不到PHP可执行文件

I am trying to setup php in VSCode. I don't want it in my global settings, so in the workspace settings I have:

{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "php.validate.enable": true,
        "php.validate.executablePath": "C:\\php\\php.exe",
        "php.validate.run": "onType"
    }
}

I downloaded PHP to c:\php...

enter image description here

But am still getting this error when I fire up the workspce:

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

图片转代码服务由CSDN问答提供 功能建议

我正在尝试在VSCode中设置php。 我不希望它在我的全局设置中,所以在工作区设置中我有:

  {
“folders”:[
 {
“path”:  “。”
} 
],
“设置”:{
“php.validate.enable”:true,
“php.validate.executablePath”:“C:\\ php \\ php.exe  “,
”php.validate.run“:”onType“
} 
} 
   
 
 

我将PHP下载到c:\ php ... < / p>

但是当我启动工作时仍然会出现此错误:

 找不到PHP可执行文件。 安装PHP 7并将其添加到PATH或设置php.executablePath设置
   
 
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzong5017 2018-05-11 14:10
    已采纳

    You also need to set php.executablePath inside the settings.json, so that everything works as it should.

    To find the settings.json file go to;

    File -> Preferences -> User Settings -> Settings.json

    And in this, make sure the following are set;

    "php.executablePath": "C:\\php\\php.exe",
    "php.validate.executablePath": "C:\\php\\php.exe"
    
    已采纳该答案
    打赏 评论

相关推荐 更多相似问题