Skip to content

[5.4] phpredis error #17623

Closed
Closed
@it-can

Description

@it-can
  • Laravel Version: 5.4.6
  • PHP Version: 7.1.1
  • Database Driver & Version: phpredis

Description:

I upgraded my app to Laravel 5.4 and start using phpredis, when running this command I get the following error:

php artisan optimize
[Symfony\Component\Debug\Exception\FatalThrowableError]
  Type error: Argument 2 passed to Illuminate\Redis\Connections\Connection::c
  ommand() must be of the type array, string given, called in /vendor/laravel/framework/src/Illuminate/Redis/Connections/
  PhpRedisConnection.php on line 36

database.php

'redis'      => [
        'client' => env('REDIS_CLIENT', 'predis'),

        'default' => [
            'host'         => env('REDIS_HOST', 'localhost'),
            'password'     => env('REDIS_PASSWORD', null),
            'port'         => env('REDIS_PORT', 6379),
            'database'     => 0,
            'read_timeout' => 60,
        ],
    ],

On my local machine I use Predis (seems to work correct), but on my production server I use phpredis, I set this value in my .env file.

.env

REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

@tillkruss

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions