This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Sonata Cache Error --> Unrecognized options "symfony" under

Discuss installing Symfony 2 here

Sonata Cache Error --> Unrecognized options "symfony" under

by Anonorpheus » Mon Aug 11, 2014 3:46 pm

I had Symfony CMF (se1.1) installed with Corebundle, Blockbundle & Adminbundle all working without errors.
Now I installed Sonata Cachebundle (needed for Sonata Pagebundle) and the site now shows this error:

InvalidConfigurationException: Unrecognized options "symfony" under "sonata_cache.caches"

(I used Composer to install this bundle.)


Here a list of my configuration files regarding the Cachebundle;

app/AppKernel.php
Code: Select all
new Sonata\CacheBundle\SonataCacheBundle(),


app/autoload.php
Code: Select all
<?php

use Doctrine\Common\Annotations\AnnotationRegistry;
use Composer\Autoload\ClassLoader;

/**
 * @var ClassLoader $loader
 */
$loader = require __DIR__.'/../vendor/autoload.php';
$loader->add('Sonata', __DIR__);

AnnotationRegistry::registerLoader(array($loader, 'loadClass'));

return $loader;


app/config/config.php
Code: Select all
sonata_cache:
  caches:
      esi:
          token: an unique security key # a random one is generated by default
          servers:
              - varnishadm -T 127.0.0.1:2000 {{ COMMAND }} "{{ EXPRESSION }}"
 
      ssi:
          token: an unique security key # a random one is generated by default
 
      mongo:
          database:   cache
          collection: cache
          servers:
              - {host: 127.0.0.1, port: 27017, user: username, password: pASS'}
              - {host: 127.0.0.2}
 
      memcached:
          prefix: test     # prefix to ensure there is no clash between instances
          servers:
              - {host: 127.0.0.1, port: 11211, weight: 0}
 
      predis:
          servers:
              - {host: 127.0.0.1, port: 6379, database: 42}
 
      apc:
          token:  s3cur3   # token used to clear the related cache
          prefix: test     # prefix to ensure there is no clash between instances
          servers:
              - { domain: kooqit.local, ip: 127.0.0.1, port: 80}
 
      symfony:
          token: s3cur3 # token used to clear the related cache
          php_cache_enabled: true # Optional (default: false), clear APC or PHP OPcache
          types: [mytype1, mycustomtype2] # Optional, you can restrict allowed cache types
          servers:
              - { domain: kooqit.local, ip: 127.0.0.1, port: 80}


app/config/routing.php
Code: Select all
sonata_cache_cache:
  resource: '@SonataCacheBundle/Resources/config/routing/cache.xml'
  prefix: /


I saw this question on Google here and there, but all unanswered or unsolved,
So I hope someone here can point out what exactly is going wrong here..
Anonorpheus
Junior Member
 
Posts: 6
Joined: Tue Aug 05, 2014 1:42 pm

Re: Sonata Cache Error --> Unrecognized options "symfony" un

by Anonorpheus » Tue Aug 12, 2014 2:20 pm

I already figured out what went wrong here..

In the app/config/config.yml file it is (obviously) not allowed to have 'options' wich are not properly configured in Symfony CMF.

An option like 'mongo' will produce an error message if this function is not properly installed and configured in Symfony CMF (sounds logical).

So, my advice is to comment out those sections that give an error. But beware that if you later on will use the full 'mongo' functionality, you have to uncomment that specific section to activate cache for it.
Anonorpheus
Junior Member
 
Posts: 6
Joined: Tue Aug 05, 2014 1:42 pm