douguai7291 2017-07-18 09:33
浏览 264

无法在Windows 10系统中的wamp或xampp中安装PHP CodeSniffer

I am trying to install code sniffer in my localhost but unable to install it.

System: Windows 10

PHP: PHP 5.4+

I have tried below methods.

  1. Open command prompt with administrative permissions (select “run as administrator “)
  2. Go to your php install directory. For example : \wamp\bin\php\php5.5.12
  3. Run this command "pear install PHP_CodeSniffer" OR "pear install --alldeps PHP_CodeSniffer"

Error:

D:\Projects\wamp\bin\php\php5.5.12>pear install PHP_CodeSniffer No releases available for package "pear.php.net/PHP_CodeSniffer" install failed

  1. Then run this command "pear clear-cache" and this also giving error like,

Error:

D:\Projects\wamp\bin\php\php5.5.12>pear clear-cache C:\Users\pcs9\AppData\Local\Temp\pear\cache does not exist or is not a directory

I have to use code sniffer "phpcs" and "phpcbf" but without install PHP_CodeSniffer its not worked.

Please help to resolve this error.

Thanks in advance!

  • 写回答

1条回答 默认 最新

  • duannv2081 2017-09-13 22:26
    关注

    PEAR is not the best way to install PHP packages nowadays.

    You could try Composer:

    composer require squizlabs/php_codesniffer --dev
    
    评论

报告相同问题?

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配