Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Memcached not working in Phalcon 5.4 cache adapter #16703

Open
pandian1989 opened this issue Feb 27, 2025 · 0 comments
Open

[BUG]: Memcached not working in Phalcon 5.4 cache adapter #16703

pandian1989 opened this issue Feb 27, 2025 · 0 comments
Labels
bug A bug report status: unverified Unverified

Comments

@pandian1989
Copy link

I recently upgraded from Phalcon 4.x to 5.4, but I'm encountering a cache issue with the Memcached adapter. I'm unable to store data on the Memcache server. Can anybody please help me on this.

$di->setShared(
    'cache',
    function () {
        $config = $this->getConfig();
        $serializerFactory = new SerializerFactory();
        $adapterFactory = new AdapterFactory($serializerFactory);

        $options = [
            'defaultSerializer' => 'Json',
            'lifetime'          => 7200,
            'servers'           => [
                0 => [
                    'host'   => 'localhost',
                    'port'   => '11211',
                ],
            ],
        ];

        $adapter = $adapterFactory->newInstance('libmemcached', $options);

        return new \Phalcon\Cache\Cache($adapter);
    }
);

Whenever use to save the cache always returning false

$this->cache->set('id', 20)

Also whenever use directly Memcached class it is working.

@pandian1989 pandian1989 added bug A bug report status: unverified Unverified labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report status: unverified Unverified
Projects
None yet
Development

No branches or pull requests

1 participant