"无法验证 php 文件.找不到php程序" [英] "Cannot validate the php file. The php program was not found"
问题描述
我是 PHP 初学者,想使用 VS Code 编辑器.但是,当我第一次保存我的 php 文件时,我收到了这条消息:
I'm a beginner in PHP and want to use the VS Code editor. However, when I first save my php file I get this message:
无法验证 php 文件.找不到 php 程序.使用'php.validate.executablePath'设置配置位置'php'
Cannot validate the php file. The php program was not found. Use the 'php.validate.executablePath' setting to configure the location of 'php'
有什么问题?
推荐答案
首先,进入File->Preferences->User settings,将出现如下图所示的窗口.
First, go to File->Preferences->User settings, A window will come like below image.
现在更改setting.json文件如下图并保存:
Now change the setting.json file like below image and save:
如果您的系统中没有安装 PHP,请从这里下载 php:windows.php.net/download,解压到 C:
驱动,设置"php.validate.executablePath": "C://path.to.your.php.folder//php.exe"
If PHP is not installed in your system, download php from here: windows.php.net/download, unzip to C:
drive, set "php.validate.executablePath": "C://path.to.your.php.folder//php.exe"
如果您的系统中安装了 php,只需设置您的 php.exe
文件的路径,如下所示:
If php is installed in your system simply set the path of your php.exe
file like below:
"php.validate.executablePath": "C://path.to.your.php.folder//php.exe"
提示:就我而言,我使用安装在 D: 驱动器中的 XAMPP,所以我的设置如下
hint: In my case I use XAMPP which is installed in the D: drive, so my setting is below
"php.validate.executablePath": "D://xampp//php//php.exe"
注意双斜杠.
这篇关于"无法验证 php 文件.找不到php程序"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!