简体   繁体   English

在vscode中配置php文件

[英]configuring php files in vscode

I run php files in Apache server. 我在Apache服务器中运行php文件。 Also, i've added in user settings the code as "php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.0.10\\php.exe", 另外,我在用户设置中添加了代码“ php.validate.executablePath”:“ C:\\ wamp64 \\ bin \\ php \\ php7.0.10 \\ php.exe”,

Still, i cant run php files? 仍然,我无法运行php文件吗? Help; 救命;

You have to install php debug extension in visual studio code 您必须在Visual Studio代码中安装php debug扩展

Try this 尝试这个

https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

or you can try below one using php xdebug extension(this works for me) 或者您可以尝试以下一种使用php xdebug扩展(这对我php xdebug

http://www.accella.net/knowledgebase/debugging-php-with-visual-studio-code/

As the name suggests, php.validate.* directives are used to configure linting (ie parsing PHP source code to detect syntax errors): 顾名思义, php.validate.*指令用于配置linting (即解析PHP源代码以检测语法错误):

Linting 林亭

VS Code uses the official PHP linter (php -l) for PHP language diagnostics. VS Code使用官方的PHP linter(php -l)进行PHP语言诊断。 This allows VS Code to stay current with PHP linter improvements. 这使VS Code与PHP linter改进保持同步。

To run PHP scripts from within the editor you have a number of choices or none at all depending on what you want to do exactly. 要在编辑器中运行PHP脚本,您可以选择多种选择,也可以完全不选择,具体取决于您要执行的操作。 You can run command-line scripts from the integrated terminal , with an extension like Runner or Code Runner . 您可以从集成终端运行命令行脚本,其扩展名为RunnerCode Runner As far as I know there's no way builtin way to lauch a browser in the preview pane that reloads as you save if that's what you mean. 据我所知,如果这就是您的意思,则无法在预览窗格中内置任何方式在您保存时重新加载浏览器。 And you can certainly configure a debugger . 您当然可以配置调试器

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM