Gii and error 404

I’m trying to test gii and using documentation step by step but when going to http://yii.local/index.php?r=gii but it return Error 404 is there something wrong with document online/PDF is the same.

Try http://yii.local/gii

:) even worse it throw an

Object not found!

The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.

If you think this is a server error, please contact the webmaster.

Error 404

Have you added gii module to your main.php config file? Are you using localhost (127.0.0.1) to run Yii?

yes I added to my config file exact the same as explain in document guide and yes I using localhost

Oh damn it :(

sorry samdark really sorry there was a mistake in my apache vhost file and it switch to an old and wrong version of another yii webapp.

my bad.

i have meet the same problem and how can i solve

It’s over a week I’m trying to create a project in Yii Framework on my localhost. I’ve tried with WampServer/XAMP/Zend Server/Apache/… but I always have same problem with gii.

It’s what I’ve done :

  1. a localhost server (like XAMP) installed

  2. Yii Framework zip file extracted to htdoc folder

  3. yii webapp test1 -> in command line

  4. http://127.0.0.1/yii/framework/test1/index.php -> it is ok and it shows my welcome screen with no problem

  5. http://127.0.0.1/yii/framework/test1/index.php?r=gii -> Always Problem ->

output:

Error 404

Unable to resolve the request "gii".

  1. I have edited my main.php and test codes like :

                'gii'=>array(
    
    
     	'class'=>'system.gii.GiiModule',
    
    
     	'password'=>'123456',
    
    
               'ipFilters'=>array('127.0.0.1'),
    
    
     ),
    

but nothing changed and I have the problem so. Please solve this problem coz I think it is a big problem for a ot of Yii beginners like me.

Thx

It seems like you created the webapp (using a relative path ) under the framework folder. That may be the cause of the gii problem (I’m surprised you managed to display the application start page but I never tried that)

Alternatives

1. Use an absolute path for the webapp

2. Instead change directory one level up and use the command framework/yiic webapp test1

3. Move the webapp you already have one level up, then in index.php, modify the path to the framework.

/Tommy

I also encountered the same problem.

but it was a simple reason.

I forgot to delete the comment out.

in main.php

‘modules’=>array(…

/*

‘gii’=>array(

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


'password'=>'admin',

*/

Having a similar issue here.

Following suggestions by Larry Ullman

Also following the SEF configurations detailed in the wiki

Created site by this command:

[list=1]

[*]./yiic webapp /var/www/yii/public

[*]moved protected to /var/www/yii

[*]edited index.php and index-test.php to reflect corrected $config

[*]edited protected/config/main.php to enable urlManager

[*]added .htaccess file

[/list]

All of the default menu items work (Home, About, Contact, Login/Logout)

[list=2]

[*]edited main.php to enable gii

[*]edited password for gii

[*]changed ipFilters = false (per docs, this enables access by all ip addresses)

[/list]

by browsing /yii/public/gii I receive the gii login - when I type my password, I’m presented the following error.

Error 404

Unable to resolve the request "gii/list".

Anyone seen this?

I just bought the Yii book from Packt. I’ll revisit the issue once I’ve made it through the book and understand Yii a little better.

What I’ve seen looks awesome. Coming from Joomla development, I think this will be a pleasure once I’m past the learning curve.

Yeah, I couldn’t get it to work with ‘ipFilters’=>array(false) either.

I found this in another topic, and it was strongly warned that this is unsafe - but in development environments it should be ok, and as long as gii is disabled before going public I think it should be ok too.

Try setting ‘ipFilters’=>array($_SERVER[‘REMOTE_ADDR’]),

This accomplishes what array(false) promises.

Just remember that anyone can get to your gii now.

Setting up a second webapp, I tried revisiting the ‘false’ configuration for ipFilters and it turns out I was using it wrong.

I was trying this:


'ipFilters'=>array(false),

when it was supposed to be this:


'ipFilters'=>false,

So, anyway, it accomplishes the same as my previous suggestion using REMOTE_ADDR, but as far as the documentation goes, it does work with false when used correctly.

I was having this problem as well, but following the steps laid out here in the Gii help it was pretty easy to fix.

hope this helps.

I had this problem and found out that the problem was in the url rewrite, so the solution is to create urlManager rules for gii.

Specific urlManager rules for gii:


'gii' => 'gii',

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

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



My urlManager configuration (remember: you also have to configure .htacess for this):




'urlManager'=>array(

		        'urlFormat'=>'path',

		        'showScriptName'=>false,

		        'urlSuffix'=>'.html',

		        'rules'=>array(

				'gii' => 'gii',

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

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


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

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

		            '<controller:\w+>/<id:\d+>/<title>'=>'<controller>/view',

		            '<controller:\w+>/<id:\d+>'=>'<controller>/view',

		        ),

		),




I am having similar kind of problem, i have my gii running fine and generated user model by following this tutorial "Creating Your First Yii Application "

but when i try to access user list by this index.php?r=user (my first post and i am not allowed to post complete link :@) it’s giving error

Error 404

Unable to resolve the request "user".

Please help

Hi,

I had this problem too. I troubleshot by creating a fresh test app using the Yiic tool in the command line and comparing the two protected/config/main.php files. I found I had accidentally rearranged the nested gii/modules array inside another one when it was supposed to be directly under the main returned array.

Also try replacing your main.php config file with a fresh one created by yiic. Gii should work then. Then spot the difference between that and your original main.php.

Hope this helps.

Hey everyone, :)

I had the same problem with Gii. First it was a 404 not found error page appearing when I was trying to reach “app/index.php?r=gii”. I finally found out that I was wrote the “import” and “modules” configurations accidentally inside of the “components” section in my config file. Secondly, I got an error about Assets “basePath”. I didn’t used yiic to generate the basic structure, so I found out that I have to make directories “assets” and “runtime” on the root directory which must be writable also.

After I fixed these two things, I got the login page! :)

Hope it helps! :)

This was my case. I configured urlManager to ‘urlFormat’=>‘path’ and because of this I had to add the following rules, before the existing ones, for it to work:

‘gii’=>‘gii’,

‘gii/<controller:\w+>’=>‘gii/<controller>’,

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

Thanks for the tip.