[SOLVED] yiic shell module problem

I ran yiic shell

after that created module admin, after that want create model Users in module admin. It isn’t work for me.

My dump:

Yii Interactive Tool v1.1 (based on Yii v1.1.1)

Please type 'help' for help. Type 'exit' to quit.

>> module admin

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/messages

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/views

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/views/default

   generate views/default/index.php

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/views/layouts

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/components

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/controllers

   generate controllers/DefaultController.php

      mkdir /home/ilyatau/Work/projects/LookAway/protected/modules/admin/models

   generate AdminModule.php

Module 'admin' has been created under the following folder:


You may access it in the browser using the following URL:


Note, the module needs to be installed first by adding 'admin'

to the 'modules' property in the application configuration.

>> model admin.models.Users users

   generate models/Users.php

Warning: file_put_contents(/Users.php): failed to open stream: Permission denied in /home/ilyatau/Work/yii-last/framework/console/CConsoleCommand.php on line 154

  unchanged fixtures/users.php

  unchanged unit/UsersTest.php

Warning: include_once(/Users.php): failed to open stream: No such file or directory in /home/ilyatau/Work/yii-last/framework/cli/commands/shell/ModelCommand.php on line 366

Warning: include_once(): Failed opening '/Users.php' for inclusion (include_path='.:/home/ilyatau/Work/projects/LookAway/protected/modules/admin:/home/ilyatau/Work/projects/LookAway/protected/components:/home/ilyatau/Work/projects/LookAway/protected/models:/usr/share/php5:/usr/share/php') in /home/ilyatau/Work/yii-last/framework/cli/commands/shell/ModelCommand.php on line 366

The following model classes are successfully generated:


If you have a 'db' database connection, you can test these models now with:




I received Warnings, and modules/admin/models is empty

Thank you.


I find something. After creating admin module

>>module admin

I can’t use it.

I wrote in config/main.php


but if I try url: http://localhost/LookAway/index.php?r=admin

It’s gave me

Any ideas?

Thank you


I don’t know why but if I write




it does not work, if before it work

Why it’s happend?

Thank you


Are you sure you aren’t putting it inside components array when you intend after?

During development environment you should put it like :-


	// uncomment the following to enable the Gii tool





	 	// If removed, Gii defaults to localhost only. Edit carefully to taste.





But in Production you should comment in "gii module" for security reasons and should put your module after component like this (be care full it should not present within component block) :-