【问题标题】:Class 'Predis\Client' not found loop类 'Predis\Client' 未找到循环
【发布时间】:2018-06-14 11:18:32
【问题描述】:

我尝试了所有答案here,但没有运气。

奇怪的是,如果我简单地运行命令composer update 我会得到这个:

forge@development:~/default$ composer update
Cannot create cache directory /home/forge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/forge/.composer/cache/files/, or directory is not writable. Proceeding without cache
> php artisan clear-compiled
The compiled class file has been removed.
> php artisan ide-helper:generate


  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'Predis\Client' not found

只运行php artisan ide-helper:generate 给了我

  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'Predis\Client' not found

删除整个vendor 目录然后运行composer install 给我this output

这是我的 composer.lock 和我的 composer.json 文件。

运行命令composer require predis/predis也会返回同样的错误:

> php artisan clear-compiled
The compiled class file has been removed.
> php artisan ide-helper:generate


  [Symfony\Component\Debug\Exception\FatalThrowableError]
  Class 'Predis\Client' not found

你有什么想法吗?

更新

这是一种变通方法,但不是根本解决方案。运行:

 composer update --no-scripts

这将跳过

"scripts": {
    "post-install-cmd": [
       ..
    ],
    "pre-update-cmd": [
        "php artisan clear-compiled",
        "php artisan ide-helper:generate",
        "php artisan ide-helper:models -N",
        "php artisan optimize"
    ],

部分,现在已经足够了。这确实看起来像是 laravel-ide-helper 的错误,很快就会报告错误。

【问题讨论】:

  • 你能告诉我们你的作曲家需要代码吗

标签: php laravel composer-php


【解决方案1】:

来自laravel-ide-helper自述文件:

当您收到有关未找到的类的 FatalException 时,请检查您的配置(例如 .... 在您不使用 Redis ServiceProvider 时删除它)

因此,如果您不使用 Redis,请从 config/app.php 中删除 RedisServiceProviderRedis 别名。然后使用php artisan config:clear 清除配置缓存。

【讨论】:

  • 除了我正在使用它!这一切的重点是从 beanstalk 迁移到 redis!
  • 我已经在这里添加了相同的问题作为对现有问题的评论:github.com/barryvdh/laravel-ide-helper/issues/172
  • @abbood 但它与原始问题无关。你真的应该开始一个新的问题。
  • 好的,然后发布链接.. @gym now :p
  • 现在一个快速的解决方法是简单地运行 composer update --no-scripts.. 这将跳过 -update-cmd": [ "php artisan clear-compiled", "php artisan ide-helper:generate", "php artisan ide-helper:models -N", "php artisan optimize" ], 部分
猜你喜欢
  • 2017-12-24
  • 2016-12-02
  • 2016-04-24
  • 2019-08-29
  • 2017-05-30
  • 2017-11-29
  • 2017-04-08
  • 2018-04-02
  • 1970-01-01
相关资源
最近更新 更多