Yii Framework Forum: Error during tutorial/setup (CWebApplication.db is read only error) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Error during tutorial/setup (CWebApplication.db is read only error) Rate Topic: -----

#1 User is offline   lucifurious 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 15-March 09
  • Location:Atlanta, GA.

Posted 15 March 2009 - 01:34 PM

Hi all... thanks in advance for the help...

I've installed the latest version of Yii and created my first webapp per the tutorial.

I added the 'db' section to my main.php as follows:

        //      Database
        'db' => array(
                'class' => 'CDbConnection',
                'emulatePrepare' => true,
                'autoConnect' => true,
                'persistent' => true,
                'connectionString' => 'mysql:host=localhost;dbname=xxx;',
                'username' => 'xxuser',
                'password' => 'xxuser',
        ),

However, when I run my site now, I'm getting an exception:

CException
Description
Property "CWebApplication.db" is read only.

Source File
/usr/local/yii/framework/base/CApplication.php(783)

==================

1. Why?
2. Nobody else seems to be getting this?
3. What did I do wrong?

If I remove the 'db' section from main.php, the exception goes away.

Help is appreciated.
0

#2 User is offline   lucifurious 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 184
  • Joined: 15-March 09
  • Location:Atlanta, GA.

Posted 15 March 2009 - 01:38 PM

Nevermind, I'm retarded.

'db' section needs to be under 'components' array. I had it at the top.

Thanks!
2

#3 User is offline   miro 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 08-June 09

Posted 08 June 2009 - 08:13 AM

10x for information, it was userful
0

#4 User is offline   joyal 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 21-June 12

Posted 26 August 2012 - 02:07 AM

View Postlucifurious, on 15 March 2009 - 01:38 PM, said:

Nevermind, I'm retarded.

'db' section needs to be under 'components' array. I had it at the top.

Thanks!


Thanks for the information.
0

#5 User is offline   tf.alves 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 07-November 12

Posted 13 September 2013 - 09:18 AM

View Postlucifurious, on 15 March 2009 - 01:38 PM, said:

Nevermind, I'm retarded.

'db' section needs to be under 'components' array. I had it at the top.

Thanks!


It helped me too, thanks! :)
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users