【问题标题】:I am facing a PHP_CodeSniffer Error. Can you please help me?我正面临 PHP_CodeSniffer 错误。你能帮我么?
【发布时间】:2022-01-21 01:58:15
【问题描述】:

我们的一位工程师在使用 PhpStorm 时遇到了错误。每当他在 PhpStorm 中编辑任何内容时,都会出现与 PHP_Codesniffer 相关的错误:

phpcs: env: php: 没有这样的文件或目录...

如果打开 PHPCodeSniffer 检查设置,可以看到下面的附加设置。

还有一点,在他将他的 MacOS 从 Big Sur 升级到 Monterey 12.0.1 之前,它一直运行良好。不确定此操作系统升级会影响应用程序设置。目前他无法使用 PhpStorm。

你能看一下并告诉我吗?

【问题讨论】:

  • "phpcs: env: php: No such file or directory..." phpcs 使用您的操作系统级别/系统范围的 PHP 可执行文件 .看起来你对php 没有任何东西。输入which php(还是where php?),看看它是否会显示任何结果。
  • @LazyOne: % where which 产生:which: shell built-in command/usr/bin/which..... 但除此之外,您还可以这样做 whereis php
  • @Luuk 我是 Windows 用户。在 cmd shell 中,这将是 where php。在 Linux 上应该是 which php。 Mac 上的正确命令是什么 - 遗憾的是我不知道......但我认为 which php 会起作用(P.S. 以前从未见过 whereis 命令)
  • @LazyOne:所有 3 个变体(where/which/whereis)都可​​以在我的 Mac 中使用。 ??????
  • @joseph:你检查过Install and configure PHP CS Fixer 吗?

标签: macos phpstorm codesniffer


【解决方案1】:

还有一点,在他将他的 MacOS 从 Big Sur 升级到 Monterey 12.0.1 之前,它一直运行良好。不确定此操作系统升级会影响应用程序设置。目前他无法使用 PhpStorm。

我有同样的问题。 Monterey 删除了已安装的 PHP 版本,因为 Mac OS 不再附带安装 php。 安装php,它应该再次工作。

就我而言,使用自制软件

brew install php@7.4
brew link php@7.4

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-11
    • 1970-01-01
    • 2013-01-28
    • 2021-07-31
    • 1970-01-01
    相关资源
    最近更新 更多