【问题标题】:PHP Syntax check not working - linter not workingPHP 语法检查不起作用 - linter 不起作用
【发布时间】:2020-04-01 13:53:39
【问题描述】:

我的 php linter 无法从 Atom 或命令行运行。

CMD:php -l <filename>

结果:在 C:\example\path\file.php 中未检测到语法错误


跑步:

  • Windows 10
  • php 7.3.11

已检查的内容:

  • 是的,文件确实存在
  • 衬垫已安装(版本 2.3.1)
  • linter-php 已安装(版本 1.6.1)
  • 其他 linter 工作正常
  • php.exe 的路径在包中定义,config.json

【问题讨论】:

  • Linter 告诉您,您的文件一切正常。有用。 linter 的反应让您感到困惑吗?
  • 感谢您的回复。班轮不工作,我特意添加了一个错误来检查它是否工作。结果发现 linter 没有工作,因为我使用的是短标签 <? 所以需要更改 php.ini 中的设置才能显示

标签: php atom-editor lint linter phplint


【解决方案1】:

php.ini 中的解决方案 short_open_tag=On 设置为 Off 如果您使用短标签 <? vs <?php,则需要 On 以便 linter 捕获错误。

希望这对其他人有所帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    • 2016-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多