We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

"Your config file does not appear to be formatted correctly" has taken down my site... how do I get it back?!

How Do I?

aaronboland's avatar
aaronboland
4 posts
5 years ago
aaronboland's avatar aaronboland

Hello,

Hope you can help. I’m in the middle of developing a site. I’d created some templates and was linking to them from various places. All of a sudden… Boom! I get this error message.

How would I go about getting around this error or resetting the config file? The one in in the ‘user’ folder is blank. There appears to be several others.

If I’m unable to get around this, can I do a fresh install of EE and keep the same database (which I presume is where the channel entries and channels, etc, live)? Hopefully I can roll it back via the hosting panel, though.

Cheers!

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

If you do a fresh install, it’s going to wipe everything.

You do need config.php in system/user/config/ to have some content- it’s weird that it went poof. But- try copying this into it- edit the database info so it’s correct and let’s see if we can get you back up.

<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['save_tmpl_files'] = 'y';
// ExpressionEngine Config Items
// Find more configs and overrides at
// https://docs.expressionengine.com/latest/general/system_configuration_overrides.html

$config['app_version'] = '5.3.0';
$config['encryption_key'] = '99db80b45e935db00f64efbea7e245a6faf700ee';
$config['session_crypt_key'] = 'baaf756e150f8d2a493378fb55c014e28f4b78e0';
$config['database'] = array(
 'expressionengine' => array(
  'hostname' => '127.0.0.1',
  'database' => '530',
  'username' => 'root',
  'password' => '',
  'dbprefix' => 'exp_',
  'char_set' => 'utf8mb4',
  'dbcollat' => 'utf8mb4_unicode_ci',
  'port'     => ''
 ),
);

// EOF

You may have had some other stuff in there, but this is pretty much the minimum.

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

And do make sure the version number and database info is correct. This is the file system/user/config/config.php to be clear.

       
aaronboland's avatar
aaronboland
4 posts
5 years ago
aaronboland's avatar aaronboland

Thanks so much, Robin! I copied the above settings back in, changed the db details and it’s back!

I have no idea what went wrong. I hit the ‘site offline’ button and it went straight to the “config file” message? I found the config file and saw it was empty.

Shrug

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

That is definitely not awesome (that it broke). I’ll play around a bit and see if I can replicate, but it sounds like something quirky.

Glad we were able to get it back up with just a default config!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.