doutun1875 2018-08-18 09:27
浏览 68

如何在xampp安装时在visual studio代码中运行php?

when PHP file will created in visual studio code
error message will be generated
i install all PHP related extension in vs code

error message screenshot in vs code error message screenshot in vs code

  • 写回答

1条回答 默认 最新

  • dongyou5098 2018-08-18 17:31
    关注

    This error message has nothing to do with running PHP code. According to the dialogue you've installed the phpcs extension (emphasis mine):

    This linter plugin for Visual Studio Code provides an interface to phpcs. It will be used with files that have the “PHP” language mode.

    … but didn't complete the installation instructions:

    Before using this plugin, you must ensure that phpcs is installed on your system. The preferred method is using composer for both system-wide and project-wide installations.

    The tool name is actually PHP_CodeSniffer (phpcs is the name of one of the commands it provides) and you can find more comprehensive instructions in its Github project.

    In any case you would still not done yet since you still need to configure the rules you want PHP_CodeSniffer to enforce. E.g., to enforce PSR-2 you can create a file called phpcs.xml in your project root:

    <?xml version="1.0"?>
    <ruleset name="My project coding style">
        <rule ref="PSR2"/>
        <file>.</file>
    </ruleset>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序
  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作