I've added this to the array that is returned in config/app.php:
'components' => [
'redis' => [
'class' => yii\redis\Connection::class,
'hostname' => App::env('REDIS_HOST'),
'port' => APP::env('REDIS_PORT'),
'password' => ''
],
'cache' => [
'class' => yii\redis\Cache::class,
'defaultDuration' => 86400,
'keyPrefix' => App::env('APP_ID') ?: 'CraftCMS',
],
'session' => function() {
// Get the default component config
$config = App::sessionConfig();
// Override the class to use Redis' session class
$config['class'] = yii\redis\Session::class;
// Instantiate and return it
return Craft::createObject($config);
},
]
This all works find when my environment is in dev and devMode is on.
When I switch to production, I get an internal server error. I don't know what the issue is because it doesn't give me the full logs.