gpt4 book ai didi

php - 找不到类 'Predis\Client' 循环

转载 作者:搜寻专家 更新时间:2023-10-31 21:21:08 26 4
gpt4 key购买 nike

我尝试了所有答案 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 的错误,很快就会报告错误。

最佳答案

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

When you receive a FatalException about a class that is not found, check your config (for example .... remove Redis ServiceProvider when you don't use it)

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

关于php - 找不到类 'Predis\Client' 循环,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48100138/

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