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?
Adrien was right in his comments - services.yml file isn't used by default. You have to explicitly include it in config.yml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With