Symfony2/Memcached integration

memcached, symfony

Solution

Adrien was right in his comments - services.yml file isn't used by default. You have to explicitly include it in config.yml

Problem

I was following a blog post (link no longer available) and added memcached to services.yml ``` parameters: memcached.servers: - { host: 127.0.0.1, port: 11211 } services: memcached: class: Memcached calls: - [ addServers, [ %memcached.servers% ]] ``` Then in my controller: ``` $memcached = $this->get('memcached'); ``` Looks very pretty. If I can get past `500 - You have requested a non-existent service "memcached"`! The test code from php connects to memcached without any troubles. Done cache:clear, cleared cache manually - doesn't help. Where should I look?

Original source