On Forge, you have to manually add your environment variables. Its located under site detail->environment. You have to set you database info there.
How does the .env.php has to look?
Hi, it's my first try with forge and I really are in trouble. I didn't get my database running. Always have errors like root@localhost not found...
1) Do I really have to add APP_ENV (=production) as Enviroment Variable?
2) Do I have to add an .env.php file myself? And then upload it via Bitbucket...?
3) How exactly does the .env.php file has to look like?
Thanks Kay
I'm assuming you are using L4, as L5 doesn't have a .env.php file..
1) It depends on your environment checking. L4 by default checks your servers host name, not the value of APP_ENV
2) You can add environment variables using forge as @fraserk has mentioned. If you prefer to do it the manual .env.php way then yes you will have to upload this yourself with ssh/sftp etc. The idea is this file doesn't exist in your git repo, because it contains all your api keys, and passwords etc.
3) It's just an array of data that you return, something like this:
<?php
return [
'DB_PASSWORD' => 'np9c8y2bc9nt2px8d',
'DB_USER' => 'forge',
'DB_NAME' => 'mydatabase',
// And so on...
];
Please or to participate in this conversation.