Framework requires a “database” key in DB::getConfig()

**Silverstripe Version: 4.0

Silverstripe newb alert!
Running a local host with wamp…php 7+ and mysql i believe 8. Have installed composer and used it to create a new project. It does that successfully but when i go to the install folder i get the message:

Silverstripe Framework requires a “database” key in DB::getConfig(). Did you forget to set SS_DATABASE_NAME or SS_DATABASE_CHOOSE_NAME

So i created a _SS_environment.php file with the default database credentials. I then get a mesg that says i need to remove the _SS_environment.php file and create a .env file…so i do but it makes no difference.

What am i doing wrong, obviously (i think) database related…but what…any takers on a newb case.

Cheers

Putting the database settings in .env is correct for a Silverstripe 4 site.

There should already be a .env.example file in your project root which you can use/rename to make sure you’re using the correct format.

Otherwise, please share the contents of your .env file here (replacing any passwords) and we’ll see if we can spot any issues.