5

So after migrating to Symfony v2.3 I keep getting the following message whenever I try to clear my cache:

The parameter "kernel.http_method_override" must be defined.

I've looked around Google and everyone is saying to clear the cache directories manually. I did that and also deployed a new (clean) version. The problem remains.

Can anyone provide more information about how to fix this?

Thanks

4
  • When you say you have cleared the cache manually, you mean use command or delete cache folder from your project ? Commented Jul 25, 2013 at 13:48
  • Yes, runnning rm -rf app/cache/* Commented Jul 25, 2013 at 13:53
  • And by "new clean version" do you mean that you are just using the plain default composer.json file? Or have you added all your dependencies? Commented Jul 25, 2013 at 14:31
  • By new clean version, I mean that I installed our app in a fresh computer where the app had never been ran before and after install everything I keep getting the error. Commented Jul 25, 2013 at 16:46

2 Answers 2

14

Problem occurs only when you eg. call "assets:install", "assetic:dump", BEFORE you delete the cache of the symfony's previous version.

So that explains why the problem "misteriously" dissapeared. Delete the cache folder, or call "cache:clear", before you execute any other console command.

Sign up to request clarification or add additional context in comments.

Comments

0

Based on the comment that the app was installed in a fresh computer then it does not seem likely that the cache is a problem. Though it is quite strange. As the documentation (http://symfony.com/doc/current/reference/configuration/framework.html#http-method-override) shows, this parameter was added to 2.3.

If you look in: Symfony\Bundle\FrameworkBundle\FrameworkBundle we see that that parameter is being checked in the bundle boot method.

From: Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension we see that the parameter is being added to the container with a default value of true during the build process.

So it appears that boot is being called before the build process. Consider add some die() statements to the framework code just to confirm that this indeed happening.

Then I would suggest that you try going in your AppKernel and commenting out the inclusion of all the non-standard bundles. It sort of seems that one of them might be messing around with the boot process? Sounds unlikely but maybe. Just use app/console to startup your app. Stay in debug mode.

The other option would be to start with a working standard application and then add your bundles in until the problem reappears.

BTW, what version are you upgrading from and are you using composer?

4 Comments

I was in 2.2 and i'm using composer.
Going to try a clean standard install and then add my dependencies one by one to see if I can catch any culprits. Thanks
Be sure to post whatever you find. From 2.2 the upgrade should have been easy. Just curious to see what the problem turns out to be.
Was not able to figure out what was happening. The issue just seemed to resolve itself... with no changes in my code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.