Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run in laravel, it throw exception: Class Redis not found? #6

Closed
mouyong opened this issue Dec 14, 2022 · 7 comments
Closed

Comments

@mouyong
Copy link
Contributor

mouyong commented Dec 14, 2022

image

image

php.ini content: https://github.com/joanhey/AdapterMan/blob/master/cli-php.ini

@mouyong
Copy link
Contributor Author

mouyong commented Dec 14, 2022

Laravel config/database.php: redis client is phpredis.

Laravel Cache use redis cache.

@joanhey
Copy link
Owner

joanhey commented Dec 14, 2022

Had you added redis to the php.ini that you send with the -c option.
If Redis is in /etc/php/x.x/cli/conf.d/ dir, will be loaded automatically.

If it's added in the /etc/php/x.x/cli/php.ini , and you use another php.ini, you need to add to that one.

@mouyong
Copy link
Contributor Author

mouyong commented Dec 14, 2022

you are right. When I use php -c php.ini, I need add extension = /path/to/redis.so in php.ini

@joanhey
Copy link
Owner

joanhey commented Dec 14, 2022

If you create in /etc/php/x.x/cli/conf.d/redis.ini, with extension = /path/to/redis.so.
Will be loaded automatically.

@joanhey
Copy link
Owner

joanhey commented Dec 14, 2022

Also if you use Workerman, and only 1 server, we can create a Workerman cache.
And we don't need Redis for cache.

@joanhey
Copy link
Owner

joanhey commented Dec 14, 2022

And without the -c option, will use your normal cli/php.ini.
With all your extensions and configs.

@mouyong
Copy link
Contributor Author

mouyong commented Dec 15, 2022

maybe you are right. add redis.so to php.ini.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants