PhpStorm正在为phpcs抛出一个错误 [英] PhpStorm Is throwing an error for phpcs
问题描述
PHP Code Sniffer
PHP Code Sniffer
phpcs: Can not correctly run the tool with parameters:
C:\Users\sa\AppData\Local\Temp\___0.tmp\press_home.module --encoding=utf-8
Possible tool process hangup after 5 sec.
Exclude press_home.module from PHP Code Sniffer analysis.
PhpStorm频繁抛出此消息。知道为什么PhpStorm会出现这个错误吗?
PhpStorm throwing this message frequently. Any idea why PhpStorm showing this error?
推荐答案
知道为何PhpStorm出现此错误?
Any idea why PhpStorm showing this error?
极有可能因为用于执行 phpcs
的PHP可执行文件启用了xdebug - 执行时间更长。
Extremely likely because PHP executable that is used to execute phpcs
has xdebug enabled -- execution takes longer.
两种可能的解决方案:
-
确保用于执行的PHP可执行文件
phpcs
没有启用xdebug。例如。您可以完全禁用xdebug ..或者在您的计算机上安装多个PHP,其中默认设置(如果您在终端中键入php
将使用它)没有xdebug。
Make sure that PHP executable that is used to execute
phpcs
has no xdebug enabled. E.g. you may disable xdebug altogether .. or have multiple PHP installations on your computer where default one (that will be used if you typephp
in terminal) does not have xdebug.
尝试在PhpStorm的设置中增加超时(设置/首选项|语言和框架| PHP |代码嗅探器
) 。在某些系统/设置甚至将超时增加到20+秒(这很多)可能仍然无法解决问题。
Try increasing timeout in PhpStorm's settings (Settings/Preferences | Languages & Frameworks | PHP | Code Sniffer
). On certain systems/setups even increasing timeout to 20+ seconds (which is a lot) may still unable to resolve the issue.
从性能的角度来看,#1中描述的解决方案是首选且更可靠(但实现起来更困难,尤其是如果您实际需要本地xdebug)。
Solution described in #1 is preferred from performance point of view and more reliable (but more difficult to implement, especially if you actually need xdebug locally).
这篇关于PhpStorm正在为phpcs抛出一个错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!