简体   繁体   English

如何在 Visual Studio Code 中配置 PHP 可执行文件,其中我的设置​​是 Windows 10 主机中的 Vagrant Ubuntu 16.06

[英]How to Configure PHP executable in Visual Studio Code where my setup is Vagrant Ubuntu 16.06 in Windows 10 Host machine

I have vagrant setup in my machine and I am using Homestead 7 Laravel Box for PHP development.我的机器上有 vagrant 设置,我正在使用 Homestead 7 Laravel Box 进行 PHP 开发。 My Host computer is running Windows 10.我的主机运行的是 Windows 10。

I am using Visual Studio Code 1.15.1.我使用的是 Visual Studio Code 1.15.1。

My PHP executable is not set in Visual Studio setting.我的 PHP 可执行文件未在 Visual Studio 设置中设置。 How can I configure PHP executable in my current development environment?如何在我当前的开发环境中配置 PHP 可执行文件? Thanks.谢谢。

To set it in Visual Studio Code, do the following要在 Visual Studio Code 中设置它,请执行以下操作

  • Go to File -> Preferences -> Settings.转到文件 -> 首选项 -> 设置。
  • Look for the the setting php.validate.executablePath = null, .查找设置php.validate.executablePath = null,
  • Point it to the location of the php.exe .将其指向php.exe的位置。 (eg C:\\php\\php.exe). (例如 C:\\php\\php.exe)。
  • Finally, copy it onto the User Settings pane on the right side then save.最后,将其复制到右侧的“ User Settings窗格中,然后保存。
  • Output should look like this: php.validate.executablePath = "C:\\php\\php.exe",输出应如下所示: php.validate.executablePath = "C:\\php\\php.exe",

我设法通过在每个目录之间使用 2 个斜杠来解决这个问题,如下所示...

"php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.1.9\\php.exe"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Windows 10上使用Visual Studio Code进行PHP调试 - PHP Debugging using Visual Studio Code on Windows 10 如何在 Visual Studio Code 中为每个项目/工作区设置 PHP 版本? - How to setup PHP version per project / workspace in Visual Studio Code? 如何设置主机的PHP解释器以指向容器的PHP解释器 - How do I setup my host machine's PHP interpreter to point to the container's PHP interpreter 内置服务器的PHP无法与主机中的Vagrant一​​起使用 - PHP Built in Server Not Working with Vagrant in Host Machine 使用 Visual Studio Code 配置调试 PHP 的问题 - Problem to configure Debugging PHP with Visual Studio Code 通过 Windows 10 在 Visual Studio Code 中编码 PHP 没有任何效果 - Nothing has worked to code PHP in Visual Studio Code via Windows 10 如何在 Visual Studio Code 中使用 php 设置 php 可执行路径 - How do i set php executable path in php using in Visual Studio Code 如何配置PhpStorm在Vagrant计算机上使用xdebug - How to configure PhpStorm to use xdebug on a Vagrant machine 我可以在使用Windows主机中文件的来宾OS上设置WAMP虚拟机吗? - Can I setup a WAMP Virtual Machine on my guest OS that uses files from my Windows host? 如何在Visual Studio Code中使用Xdebug调试Ubuntu中的Xampp PHP脚本 - How to use Xdebug in Visual Studio Code to debug PHP Scripts in Ubuntu for Xampp
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM