I have a production laravel application and the staging application running on the same server. I am running redis, which I am using as my queue driver. They are obviously c
I had this same problem, and it took me hours to find the solution.
https://laravel.com/docs/5.6/queues#driver-prerequisites says:
In order to use the
redisqueue driver, you should configure a Redis database connection in yourconfig/database.phpconfiguration file.
And then https://laravel.com/docs/5.6/redis#predis says:
In addition to the default
host,port,database, andpasswordserver configuration options, Predis supports additional connection parameters that may be defined for each of your Redis servers. To utilize these additional configuration options, add them to your Redis server configuration in theconfig/database.phpconfiguration file.
Reading the "connection parameters" page, I eventually found https://github.com/nrk/predis/wiki/Client-Options, which says that 'prefix' is a supported option.
So, you can edit your config/database.php configuration file to have:
'redis' => [
'client' => 'predis',
'cluster' => false,
'options'=>[
'prefix' => env('REDIS_PREFIX', 'YOUR_PREFIX_HERE')
],
'default' => [
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
],
],
I'm not sure if you then need to restart Redis or Supervisord.