我收到错误“找不到类‘PredisClient’"在 Laravel 5.2 中找不到、错误、PredisClient、Laravel

2023-09-06 15:36:09 作者:寂寂归舟影

我想在 laravel 5.2 中使用 Redis,但是我遇到了错误,比如找不到 Class 'PredisClient',我该如何解决.

I want to using Redis in laravel 5.2 however, I'm getting error such a Class 'PredisClient' not found, How I can solve it.

推荐答案

首先将 REDIS 下载到您的系统(如果您尚未安装).

进入你下载redis的文件夹并运行以下命令: First download the REDIS to your system (if you haven't already installed it).

Go to the folder where you have downloaded the redis and run this command:

cd your-redis-folder-name
make

快开学了,千万别随便给爸妈发这张图

进入你的项目目录并安装composer:

Go to your project directory and install composer:

composer 需要 predis/predis

转到您的 .env 文件并添加队列驱动程序:

Go to your .env file and add Queue driver:

QUEUE_DRIVER=redis

使用 Mail::queue() 通过队列发送邮件.请参阅 文档.

然后在你的终端运行:

use Mail::queue() to send mail via queue. See Doc.

And in your terminal run:

php artisan queue:listen 

发送.