I'm trying to set up Craft and on deployment to a staging server am getting the following error message:

An exception has been thrown during the rendering of a template ("Craft can't connect to the database with the credentials in craft/config/db.php.") in "_layout" at line 39.

The config file in question is posted up at https://gist.github.com/cole007/f32c7ba984a3d35b1d24

Any thoughts?

Cheers in advance,


  • As far as I can see your config looks absolutely fine... could it simply be a DB credential issue for that particular environment? Nov 28, 2014 at 16:02

1 Answer 1


Sorted, thanks. The keen-eyed of you will notice that there was a space character in the server connection details. Idiot

  • I'd also suggest you remove the real DB name in future too... :) Dec 1, 2014 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.