# How to set wp-config.php database values for production

**URL:** https://discourse.roots.io/t/how-to-set-wp-config-php-database-values-for-production/24282
**Category:** bedrock
**Created:** 2022-11-23T13:27:29Z
**Posts:** 4

## Post 1 by @Werner-lemon — 2022-11-23T13:27:29Z

Hello,  
I would like to use bedrock / ddev for Wordpress development and Gitlab CI/CD.

I’m struggling with a rather simple task, but maybe I try to fix this the wrong way…

My Server usses Spinup and with a gitlab hook after a push to a branch the whole repository gets pulled to the server (wordpress, plugins and themes) and should contain the latest data. Right now i get the Database connection error, because I don’t know how to separate the ddev local credentials and the production / staging credentials.

I tried to create a .env.production and set the value of WP\_ENV to production, but this was not the correct way.

Is this possible with the modified folder structure (web/app and web/wp) or do I have to use the original structure and simply put the wp-config.php with the correct credentials directly on the server?

---

## Post 2 by @Log1x — 2022-11-23T17:41:17Z

[bedrock/application.php at 6cc89564fa187340276c88105c919d417d485c7d · roots/bedrock · GitHub](https://github.com/roots/bedrock/blob/6cc89564fa187340276c88105c919d417d485c7d/config/application.php#L32) by default Bedrock is checking for the existence of `.env.local`. It sounds like you should be able to use that locally and leave `.env` for production as intended.

---

## Post 3 by @Werner-lemon — 2022-11-24T07:24:13Z

Thanks for your suggestion, but .env.local does not work, if I delete .env and only use the .env.local file, I get an database connection error after ddev restart.  
So i guess, i have to put that into a readme, that everybody who checks out the project has to create the .env file, because locally its always the same setup and gitignore that file.  
On the server I put the correct .env file. This way everything works fine, except the server .env is not in version control or secured somewhere else automatically

---

## Post 4 by @Log1x — 2022-11-24T10:02:49Z

Is your Bedrock fully up to date and contain the line checking for `.env.local` that I linked?
