安装Visual Studio 2015时,顺便下载了Visual Studio Code,试用了一下感觉功能上还是比较完善的,和Sublime Text很像。但在打开php文件的时候,总是弹出提示信息:
Cannot validate the php file. The php program was not found. Use the 'php.validate.executablePath' setting to configure the location of 'php'
意思是无法找到php程序,无法验证php文件。使用php.validate.executablePath
配置项指定php程序的位置。
配置步骤也很简单:
1、在菜单依次打开“文件”-“首选项”-“用户设置”
2、在左侧“默认设置”定位到php.validate.executablePath
(我这个版本的Visual Studio Code在662行),将配置信息复制到右侧setting.json中,并配置php.exe路径下。保存即可。
"php.validate.executablePath":"N://upupw//PHP5//php.exe",
本文固定链接
https://www.ywlib.com/archives/visual_studio_code_php_validate_executablepath.html