first time with gii - crud generator throwing a cexception

hello yii community!

So, this is my first time with yii. I have gotten the yiic to function properly and to generate my demo app.

I am trying to test the different functionalities of gii and when clicking the CRUD generator or the model generator i get:


Property "CDbConnection.0" is not defined.

with other infos:


211 unset($args[0]);

212 $class=new ReflectionClass($type);

213 // Note: ReflectionClass::newInstanceArgs() is available for PHP 5.1.3+

214 // $object=$class->newInstanceArgs($args);

215 $object=call_user_func_array(array($class,‘newInstance’),$args);

216 }

217 }

218 else

219 $object=new $type;


221 foreach($config as $key=>$value)

222 $object->$key=$value;


224 return $object;

225 }


227 /**

228 * Imports a class or a directory.

229 *

230 * Importing a class is like including the corresponding class file.

231 * The main difference is that importing a class is much lighter because it only

232 * includes the class file when the class is referenced the first time.

233 *

234 * Importing a directory is equivalent to adding a directory into the PHP include path.

line 222 being hightlighted

I have tried many solutions and searched for a while and therefore am sharing this with the community

when i go to the requirements page i get this:


Capture d’écran 2012-01-10 à 18.16.25.png

maybe this has something to do with my database

here is my main.php where are my db infos:

// application components



// enable cookie-based authentication



// uncomment the following to enable URLs in path-format












‘connectionString’ => ‘sqlite:’.dirname(FILE).’/../data/testdrive.db’,



‘connectionString’ => ‘;dbname=here i write the name’,

‘emulatePrepare’ => true,

‘username’ => ‘here i write the name’,

‘password’ => ‘*******’,

‘charset’ => ‘utf8’,


after wondering if it was the fact that i was working localy

i uploaded everything online, created a db with phpmyadmin, and knows that it is functional and accessible

i saw someone with a similar question but no real answer!! hmm hope this is not a tought problem

thanks again and don’t hesitate to ask more info!!


Capture d’écran 2012-01-10 à 18.41.13.png

Welcome to the forum.

It looks like you have some garbage character before the closing bracket of the db array.


I think there is problem with ur config file.Check that database connection string in config file.


thank you very much! indeed there were some garbage characters and everything is working fine now :D

I’m quite happy and I’ve started to implement my models etc…

how would you define these garbage characters? all i did was backspace them and rewrote them and it ended up working - was it because my characters were copied from another doc?

thanks again!

@Mangesh Lad

I’m not sure what you mean. I thought that the db array was exactly that!