Closed sunfffd closed 10 years ago
Can you try removing your .env.default file?
Hi Jose,
I removed the .env.default file, however that configuration still exist when I view in the the DebugKit's Environment tab.
Is this within your vm? Or on heroku? If it's in the vm, the env vars are set from a fastcgi_param in nginx...
It is in my VM, I tried setting fastcgi_param too but with no prevail. Thing is the other parameters in the .evn file (e.g. DEBUG, SECURITY_SALT..etc) are retrieved correctly by CakePHP, it's only the DATABASE_URL and DATABASE_TEST_URL being ignored.
Hmmm let me try and replicate the issue.
Why are you changing your db config within the vm?
Correct me if I'm wrong here:
The original .env file's DATABASE_URL is something like export DATABASE_URL="mysql://root:bananas@localhost/database_name?encoding=utf8"
Actually I just want to change the database name, as in export DATABASE_URL="mysql://root:bananas@localhost/name_of_my_database?encoding=utf8"
Should I change it else where? thanks!
No that should be fine. When you changed it in the fastcgi_params, did you also change it in your .env files? And did you restart the vm?
In my /etc/nginx/fastcgi_param there are original no DATABASE_URL and DATABASE_TEST_URL params.
I added something like fastcgi_param DATABASE_URL "mysql://root:bananas@localhost/dbname?encoding=utf8"; fastcgi_param DATABASE_TEST_URL "mysql://root:bananas@localhost/test_dbname?encoding=utf8";
these also exists in .evn file.
Then I reloaded nginx config file in vagrant with sudo nginx -s reload
It's specified in the vhost, sorry.
Ok I changed that from the default vhost file, it's working now :)
I have created a .env file and changed the settings inside. Everything is fine except the database connection string. Even if I change them, the cake engine is still loading the default one (database = database_name). Looks like it cannot be overwritten somehow.
However if I change DATABASE_URL to DATABASE_URL1 and update it in Config/database.php, it loads the config correctly.