gpt4 book ai didi

PHP CodeSniffer include_once 错误

转载 作者:IT王子 更新时间:2023-10-29 00:12:10 30 4
gpt4 key购买 nike

我正在尝试在 OS X Mountain Lion 上安装 PHP CodeSniffer - 我似乎遇到了一个奇怪的问题

运行“phpcs”时出现以下错误:

PHP Warning:  include_once(PHP/CodeSniffer/CLI.php): failed to open stream: No such
file or directory in /usr/lib/php/pear/bin/phpcs on line 31

PHP Warning: include_once(): Failed opening 'PHP/CodeSniffer/CLI.php' for inclusion
(include_path='.;/usr/lib/php/pear/share/pear/') in /usr/lib/php/pear/bin/phpcs on line 31

PHP Fatal error: Class 'PHP_CodeSniffer_CLI' not found in /usr/lib/php/pear/bin/phpcs
on line 34

文件/usr/lib/php/pear/share/pear/PHP/CodeSniffer/CLI.php 存在,这让我很困惑

最佳答案

在我的配置中,PHP/路径不在 phpcs 预期的位置。我通过创建指向缺失路径的符号链接(symbolic link)解决了这个问题。

进入pear目录并运行:

ln -s share/pear/PHP/ PHP

关于PHP CodeSniffer include_once 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14257209/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com