Using Gii Tool

I have started my new web app on live linux server

but while accessing gii , i am getting 404 error

http://mysite/test/index.php?r=site/index

this url is working

http://mysite/test/index.php?r=gii ----> error 404

as in documentations of yii , i did same work

here is gii settings


	// autoloading model and component classes

	'import'=>array(

		'application.models.*',

		'application.components.*',

	),


	'modules'=>array(

		// uncomment the following to enable the Gii tool

		

		'gii'=>array(

			'class'=>'system.gii.GiiModule',

			'password'=>'yii',

			'ipFilters'=>array('192.168.0.150'),

		),

		

	),

i also tried

127.0.0.1

and my internet external ip, this 192.168.0.150 is my DMZ ip, none of 3 are working :(

any help

i am using Yii 1.1.4

Is their any problem if yiic shell is depricated and gii is not working?

  1. Have you verified that it does work locally for you? And then, can you configure it to be ‘false’ briefly on the remote server to verify that it works? (this would allow any IP, so something you would want to quickly turn off)

  2. Have you absolutely verified your IP (say by visiting http://www.whatismyip.com/) to know you have the right address value?

  3. Finally, you could echo out the results of this:


Yii::app()->request->userHostAddress

somewhere in your app and to verify that value is the same as the one you are using to configure ipFilters().

well you see this url directly :D

http://sn.woebooks.com/test/

no one can solve it :(

Since you get a 404 it’s rather not a problem with authentication since this would give you a 403. It looks more like Yii is not able to resolve the Request to any module/controller/action. This usually happens if no gii module is configured at all. So could you double check that you’re using the correct config file? Maybe post it here, if you still can’t make it work.

It’s difficult to help you if we cannot duplicate this error…

If gii is set OK… you would get the enter password or "You are not allowed to access this page" message…

as you are getting “unable to resolve the request ‘gii’” - it should be something with the configuration… urlManager?

well i showed the file i edited in that test directory

anyhow , tell me whats exact directory path of gii … and where that gii folder should be placed in it

i created that test application using YIIC tool in command shell

Gii is in the Yii framework, if you are using Yii 1.1.4, Gii is there…

we can’t see your config file… you posted only the part with import and gii…

now my site GII is showing

error 403

http://yii.woebooks.com/test/index.php?r=gii

how to solve this error… Yii should put some good documentation

I think Gii should echo the client ip number in cases like this - too many people run into problems getting started. Of course an alternative to the command line (yiic webapp) would be preferable too.

/Tommy

It’s a 403 error which probably means the IP is wrong.

Use this:

http://www.whatsmyip.org/

Gii has a very good documentation… and as it says… it has no problem when run localy… and to use it remotely you have to set your IP address so that GII "knows" you

http://yiiframework.com/doc/guide/1.1/en/topics.gii#using-gii

If you want to use it remotely (eg. from your web server)… than you should think mainly about security… so writing IP address out is not a good idea…

From your above topic

// ‘ipFilters’=>array(…a list of IPs…),

WHICH IP SHOULD BE IN LIST?

I tried , server, and ip from where i an accessing both are not working


'components'=>array(

    ......

    'urlManager'=>array(

        'urlFormat'=>'path',

        'rules'=>array(

            'gii'=>'gii',

            'gii/<controller:\w+>'=>'gii/<controller>',

            'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>',

            ...existing rules...

        ),

    ),

)

Where is this file?

we can access Gii via the URL http://hostnamepath/to/index.php/gii. We may need to add the following URL rules to the front of the existing URL rules:

well i will try this on local host later

Thank You

Hi,

I am new for yii framework.

Please some one help me with gii tool which is used for code generation i configure all necesarry details with modules section which is in config/main.php but still i am not getting any window asking for authentication please see below link -

/127.0.0.1/CrudDemo/index.php?r=gii

as i refer the gii tools reference done every thing but i am not getting any link for code generation or not getting alert for authentication.

I too had the same problem with accessing the Gii tool for yii on my localhost but than commented out the url manager section in main.php under the config directory. Also the gii login url is as follows:

http://localhost/Your-project-folder/www/index.php?r=gii/default/login