Question

I'm currently working on symfony2 projects. Each time, the deployment process is a real pain in the back (even with the cookbook advices).

I have this strange feature that I can't explain. My post variables are always empty in some bundles of symfony 2, no matter how I access them ($_POST['foo'] or request->get('foo')). This feature is online only. On my local server, it works perfectly well.

Example 1: coresphere console bundle

I'm using the coresphere console bundle to run command line on my ovh remote server. But the bundle commands were never working (no matter what my installation was) ie my post variables were always empty causing each command to crash. I thought that may be an error in some of my other installed bundles was causing the post variables of the console bundle to be empty. So I installed it on an empty symfony2 project (I even removed Acme and of course I tested that everything was working on my local server before uploading the project). The console still didn't work. My only solution (a bad one though) was to hack the javascript console.js of the bundle and transform the post request into get request. It then worked fine. At this stage I thought: "ok may be the problem comes from ajax post request on ovh?"

Example2: A home made bundle for a project

I build a bundle for a project. In this project I don't use ajax post request at all. And still, my post variables are always empty (I remind that locally, everything works just smoothly). For this bundle I'm using FOSUserBundle with HWIOAuthBundle for authentication (if it has anything to do with that?)

Summary

I'm clueless about what is going on and I would like to have some sort of track to follow. Just as a reminder: I'm using an OVH shared server with the performance package. I can use git up there. But I can't really use console command (even in ssh). So that's why I'm using the coresphere console bundle.

Thank you for your help.

Was it helpful?

Solution

I got a solution for my home made bundle:

The problem was coming from my routing.yml file (in app/config). I was using fosjsrouting and it seems that the routing of fosjsrouting needs to be called at the very end of the routing.yml file (in app/config).

See below:

app/config/routing.yml:

... and at the very end:

fos_js_routing: resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"

However, I still don't understand the problem with the coresphere bundle. This doesn't solve it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top