Different config for development and production

I’ve cloned the Gulp/Kirby StarterKit and was wondering about the different config files like config.localhost.php or config.example.com.php etc.

How to use this different config’s for development and production?

Because in my config.localhost.php debug is set to true but doesn’t have an effect.

Your site is available at http://localhost?

Yes the site is running on http://localhost. Where are the settings for the different config files?

Simplest way would be to use config.php for local, and use domain specific configs for live and staging remote servers. You don’t need copy the whole config into those domain based ones as they inherit config.php. Just add the specific parts you wish to change.

There’s a certain risk doing it that way as you have to think about disabling stuff you enabled in the general config. I’d try to avoid that.

Ok, thanks. I will do that.

But why it is solved with different config’s in the gulp starterkit? Just to understand the difference.

Are you using the built in php server (not recommended) or something like mamp or valet? Maybe you didnt set server to false as directed if you are not using the built in php server. basically for some reason, Kirby cannot tell it is running on localhost, so the config isnt getting used.

I’m using the built in server and start it with npm start from the terminal.

Just as a side note, Kirby uses gd lib thumbs driver, for some reasons I had to use ImageMagik on remote and gd on local.

I had to specify the choosen thumb driver in each config file to make it work correctly.

The way it is solved in the Gulp-Starterkit is the way I would recommend, with debugging set to true only for localhost.

1 Like