I have a properly installed Symfony2 environment for my web application, which is connected to a certain mysql database.
I am trying to set a physically separated Testing Environment to use it as the pre-production testing environment as a "mirror" of production, locating a copy of the whole project in a subfolder of the "www".
Something like:
www
|app
|config
|parameters.ini
|src
|vendor
|web
(...)
|testing_environment
|app
|config
|parameters.ini
|src
|vendor
|web
(...)
Take a look to the parameters.ini
files. In the upper one (the one in the production environment), I have set the connection of the production database with its hostname, database name, user and password.
In the second parameters.ini
(the one under testing_environment/app/config), I have set a different database connection pointing to what it will be the testing database.
My plan is to access to the production environment just putting www.myproject.com/web/main
and to the testing environment going to www.myproject.com/testing_environment/web/main
. One accesing each database separately.
Actually, I do get to access the testing environment, seen the testing version of my project, with its different set of directories, subdirectories and files. But, for some reason, the database properties that are being used both going to www.myproject.com/web/main
and to www.myproject.com/testing_environment/web/main
are the ones set in production parameters.ini
file, causing that the only data accessed and modified is the production environment one, no matter what environment I am accessing in my browser.
Why this happens? Isn't it all relatively referenced? Wouldn't the testing environment have to be pointing to its own parameters.ini with its different database connection properties?
I have read Symfony2 documentation about setting different environments with different configurations, bundles and/or toolbars. But that doesn't allow to work with a different set of databases and directories/files.
What am I missing? How do I get what I need without hiring a diferent hosting for my pre-production testing works?