• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
intermittent error "Your config file does not appear to be formatted correctly."

#1
[eluser]ManOfTheHour[/eluser]
Hi fellow Codeigniterers!

I have run into a curious issue I can not track down.

I get intermittent "Your config file does not appear to be formatted correctly."

Set a trap in Common.php to see what's going on, no error on *require* the config file but the $config variable
is not there. Gone. Just like that.

This issue happens *sometimes* , have not found out what sequence of page/ajax calls trigger this.
Calling the same page right after usually comes back ok.

I am running out of ideas where to look.

Using
- hooks,
- enabled get query strings,
- $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\=+-';

All that has not changed before or after the problem started.

I hope you can point me a way out of this mess? Thanks!!!

#2
[eluser]CI_avatar[/eluser]
Please post the actual error so that we can help you easily.

#3
[eluser]ManOfTheHour[/eluser]
@CI_Avatar:
Thanks for responding. This IS the message. See
codeigniter/Common.php, ~line 187:
Code:
require(APPPATH.'config/config'.EXT);

        if ( ! isset($config) OR ! is_array($config))
        {                    
            exit('Your config file does not appear to be formatted correctly.');
        }

CI does not find it amusing to have no $config array to play with and stubbornly exits......

I did another test and checked if the $config array was actually present BEFORE the "require" call. Funny enough it was....... question is how that can be?

For fun and giggles I did this:
Code:
if(!isset($config))                         // <=========== only load if $config is not there
require(APPPATH.'config/config'.EXT);

        if ( ! isset($config) OR ! is_array($config))
        {                    
            exit('Your config file does not appear to be formatted correctly.');
        }

Everything still works. Haven't had time to test yet. Will report when I have.

Edit:
No change after above. Problem still there.
Now trying
Code:
if(!isset($config))   unset($config);                      // <===========
require(APPPATH.'config/config'.EXT);

        if ( ! isset($config) OR ! is_array($config))
        {                    
            exit('Your config file does not appear to be formatted correctly.');
        }

#4
[eluser]CI_avatar[/eluser]
We can hardly track the changes you've made. You may undo the changes by replacing the CI with the original code and retry. Sorry for not answering your question.

#5
[eluser]InsiteFX[/eluser]
That error is usally caused by adding something to the
config file that is not formated correctlly!

InsiteFX

#6
[eluser]Wayne Smallman[/eluser]
I just started seeing the exact same error today; intermittent but totally annoying.

I've not made any recent changes to the configuration file, certainly not close enough in time to segue with the start of this error.

#7
[eluser]ManOfTheHour[/eluser]
@InsiteFX : you crack me up..... !!

I remember after reinstalling the system directory the error went away.
Would still love to know what triggered that in the first place.
I *hate* not knowing.... Wink

#8
[eluser]InsiteFX[/eluser]
Well I have downloaded CodeIgniter just to install it
and found out it did not work!

Sometimes the download will say that it is finished but
in fact it is corrupted!

Always try re-downloading it and re-install.

InsiteFX

#9
[eluser]Wayne Smallman[/eluser]
OK, I've just confirmed what I'd suspected, and that the error I'm getting appears only to be happening with Chrome.

Also, this isn't a new installation of CodeIgniter; the project is months old.

As I said, this error only started recently, which I now think is somehow linked to me using Chrome (version 6.0.472.63 on Mac OS X 10.6.4).

#10
[eluser]InsiteFX[/eluser]
Check the application/config/user_agents.php file

Your version of chrome may not be in there.

This was mentioned someplace else on the forums before.

InsiteFX


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.