joanhey / AdapterMan

Run almost any PHP app faster and asynchronously with Workerman, without touch 1 line of code in your fw or app. Also use it as Serverless.
https://twitter.com/adaptermanphp
MIT License
763 stars 50 forks source link

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

Closed mouyong closed 1 year ago

mouyong commented 1 year ago
image image

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

mouyong commented 1 year ago

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

Laravel Cache use redis cache.

joanhey commented 1 year ago

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 commented 1 year ago

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

joanhey commented 1 year ago

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

joanhey commented 1 year ago

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

joanhey commented 1 year ago

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

mouyong commented 1 year ago

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