# Configuring Memcache or Redis in local.php?

**URL:** <https://forum.mautic.org/t/configuring-memcache-or-redis-in-local-php/27267>\
**Category:** Product Support\
**Created:** [March 6, 2023, 10:31am UTC](https://forum.mautic.org/t/configuring-memcache-or-redis-in-local-php/27267 "2023-03-06T10:31:39Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [March 7, 2023, 7:20am UTC](https://forum.mautic.org/t/configuring-memcache-or-redis-in-local-php/27267/12 "2023-03-07T07:20:40Z")

</div>

Hi @m.abumusa - thanks for all the information.

I will start with memcached. Before reaching out I had done a bit of research and found a similar post on Redis: [Mautic Cache Redis config - #2 by mzagmajster](https://forum.mautic.org/t/mautic-cache-redis-config/20176/2)  
which references a fix for the Redis adapter :[Add RedisAdapter from Symfony 4 for CacheBundle by kuzmany · Pull Request #10889 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/10889)

However after implementing a number of variations of the code placed above in my local.php file, I constantly get a broken Mautic.

I add the following code:

```auto
        'parameters' => (
                'cache_adapter' => 'mautic.cache.adapter.filesystem',
    'cache_prefix' => '',
    'cache_lifetime' => 86400,
    'cache_adapter_memcached' => (
        'servers' => ('memcached://localhost'),
        'options' => (
            'compression' => true,
            'libketama_compatible' => true,
            'serializer' => 'igbinary',
        ),
    ),

```

which results in the following error:

```auto
2023/03/07 07:12:10 [error] 3856#3856: *8874 FastCGI sent in stderr: "PHP message: PHP Notice - Undefined variable: inline - in file /var/www/mautic/offline.php - at line 77PHP message: PHP Notice: Undefined variable: inline in /var/www/mautic/offline.php on line 77PHP message: ParseError: syntax error, unexpected '=>' (T_DOUBLE_ARROW) - in file /var/www/ams/app/config/local.php - at line 769" while reading response header from upstream, client: 46.116.227.13, server: ams1.surge-ams.com, request: "GET /s/dashboard HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "mtest.surge-ams.com", referrer: "https://mtest.surge-ams.com/s/login"

```

I have played around a lot with positioning the code and changing parenthesis with the square brackets however am unable to get it to not break Mautic.

I have checked and bot memcached and the php extension are installed and I am also able to telnet into memcached port and run stats items there to see if there is any data - unfortunately not, but the service is running.

Have you managed to get this work

---

_[View the full topic](https://forum.mautic.org/t/configuring-memcache-or-redis-in-local-php/27267)._
