I get error message when I try to running horizon in laravel 6 and this error is
LogicException : Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.
at /Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:72
68| protected function createClient(array $config)
69| {
70| return tap(new Redis, function ($client) use ($config) {
71| if ($client instanceof RedisFacade) {
> 72| throw new LogicException(
73| 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
74| );
75| }
76|
Exception trace:
1 Illuminate\Redis\Connectors\PhpRedisConnector::Illuminate\Redis\Connectors\{closure}(Object(Illuminate\Support\Facades\Redis))
/Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Support/helpers.php:424
2 tap(Object(Illuminate\Support\Facades\Redis), Object(Closure))
/Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:94
Please use the argument -v to see more details.
and when I try to rename Redis Facade in config/app.php, I get diveren messege like this
Symfony\Component\Debug\Exception\FatalThrowableError : Class 'Redis' not found
at /Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:70
66| * @throws \LogicException
67| */
68| protected function createClient(array $config)
69| {
> 70| return tap(new Redis, function ($client) use ($config) {
71| if ($client instanceof RedisFacade) {
72| throw new LogicException(
73| 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
74| );
Exception trace:
1 Illuminate\Redis\Connectors\PhpRedisConnector::createClient()
/Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:26
2 Illuminate\Redis\Connectors\PhpRedisConnector::connect(["127.0.0.1", "6379"], ["redis", "laravel_database_"])
/Users/tay/Sites/idpay/vendor/laravel/framework/src/Illuminate/Redis/RedisManager.php:109
Please use the argument -v to see more details.
Redis Driver & Version: predis/phpredis ?
Which driver are you using? If phpredis: do you have the ext-redis extension installed as documented here: https://laravel.com/docs/6.0/redis#introduction ?
1 Replace in config\app.php
aliasess:
'Redis' => Illuminate\Support\Facades\Redis::class,
for:
'RedisManager' => Illuminate\Support\Facades\Redis::class,
2 Replace in config\database.php
'redis' => [
'client' => env('REDIS_CLIENT', 'predis'), //default phpredis
...
Looks like you got bitten by the change to the skeleton as well. We added a note about this in the upgrade guide: https://laravel.com/docs/6.0/upgrade#redis-default-client. Try the solution from @JavBautista
Problem solve I change redis clinet from phpredis to predis.
Thanks for all
Solved it by running pecl install redis on Mac OS and then valet restart (if you don't use valet, restart PHP)
I still have this problem. Running Horizon gives me:
Class 'Redis' not found
at vendor/laravel/framework/src/Illuminate/Redis/Connectors/PhpRedisConnector.php:74
70| * @throws \LogicException
71| */
72| protected function createClient(array $config)
73| {
> 74| return tap(new Redis, function ($client) use ($config) {
75| if ($client instanceof RedisFacade) {
76| throw new LogicException(
77| extension_loaded('redis')
78| ? 'Please remove or rename the Redis facade alias in your "app" configuration file in order to avoid collision with the PHP Redis extension.'
• A class import is missing: You have a missing class import. Try importing this class: `Illuminate\Support\Facades\Redis`.
+22 vendor frames
23 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
I have redis correctly installed. This route returns me the key that I've set.
Route::get('/redis', function () {
$app = RedisManager::connection();
$app->set('key', 'Redis is working just fine');
echo $app->get('key');
});
I also changed the Facade from 'Redis' to 'RedisManager'. I'm not using predis if i am correct.
I'm using valet linux with PHP 7.3 FPM.
Most helpful comment
1 Replace in config\app.php
aliasess:
'Redis' => Illuminate\Support\Facades\Redis::class,
for:
'RedisManager' => Illuminate\Support\Facades\Redis::class,
2 Replace in config\database.php
'redis' => [