Mautic v. 4.4 and 5.X
My PHP version is : 8.0
*My MySQL/MariaDB version is: MySQL 5.7
Updating/Installing Errors
I am (delete as applicable): Installing
Upgrading/installing via (delete as applicable) : Web + Command Line
These errors are showing in the installer : None
These errors are showing in the Mautic log : None
Your problem
I’m trying to setup Mautic in a docker container with Redis as a Cache backend.
But I just can’t get Mautic to keep /var/cache empty and store any cache values in Redis.
I have tried both version 4.4 and the latest 5.x
Steps I have tried to fix the problem:
Installing with someting like this:
git clone GitHub - mautic/mautic: Mautic: Open Source Marketing Automation Software.
cd mautic
composer install
[Doing the rest of the install from the web interface]
Adding this to app/config/local.php:
…
// Cache
'cache_adapter' => getenv("CACHE_ADAPTER") ?? "mautic.cache.adapter.redis",
'cache_prefix' => getenv("CACHE_PREFIX") ?? "app_cache",
'cache_lifetime' => getenv("CACHE_LIFETIME") ?? "86400",
'cache_adapter_redis' => [
'dsn' => getenv("REDIS_DSN") ?? "redis://local-dev-redis",
'options' => [
'dbindex' => getenv("REDIS_OPTIONS_DBINDEX") ?? 0,
'lazy' => getenv("REDIS_OPTIONS_LAZY") ?? false,
'persistent' => getenv("REDIS_OPTIONS_PERSISTENT") ?? 0,
'persistent_id' => getenv("REDIS_OPTIONS_PERSISTENT_ID") ?? null,
'timeout' => getenv("REDIS_OPTIONS_TIMEOUT") ?? 30,
'read_timeout' => getenv("REDIS_OPTIONS_READ_TIMEOUT") ?? 0,
'retry_interval' => getenv("REDIS_OPTIONS_RETRY_INTERVAL") ?? 0,
]
],
ENVIRONMENT vars:
# 'local-dev-redis' is the name of the docker container
REDIS_DSN="redis://local-dev-redis"
REDIS_OPTIONS_DBINDEX="5"
REDIS_OPTIONS_LAZY="false"
REDIS_OPTIONS_PERSISTENT="0"
REDIS_OPTIONS_PERSISTENT_ID="null"
REDIS_OPTIONS_READ_TIMEOUT="0"
REDIS_OPTIONS_RETRY_INTERVAL="0"
REDIS_OPTIONS_TIMEOUT="30"
CACHE_ADAPTER="mautic.cache.adapter.redis"
CACHE_LIFETIME="86400"
CACHE_PREFIX="mautic_"
And finally clearing the cache:
./bin/console cache:clear env=prod
And nothing shows up in redis and cache files piles up in /var/cache …
What is the proper way of doing this - how do you configure Mautic with Redis?
Pages of inspiration:
https://developer.mautic.org/#configuration