Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii 1.1.7 - cannot find gii page

I want to use Gii in Yii. My protected/config/main.php for my first webapp has this part uncommented, as instructed in the Yii documentation to enable Gii (123.45.67.123 is my public IP address from the computer I am trying to access):

'modules'=>array(
            // uncomment the following to enable the Gii tool
            'gii'=>array(
                    'class'=>'system.gii.GiiModule',
                    'password'=>'123456',
                    // If removed, Gii defaults to localhost only. Edit carefully to taste.
                    'ipFilters'=>array('123.45.67.123','127.0.0.1','::1'),
            ),
    ),

I also have the urlManager enabled in my protected/config/main.php by uncommenting the below:

// uncomment the following to enable URLs in path-format
            'urlManager'=>array(
                    'urlFormat'=>'path',
                    'rules'=>array(
                            '<controller:\w+>/<id:\d+>'=>'<controller>/view',
                            '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
                            '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
                    ),
            ),

When I go to my Yii site, for example, www.example.org, the basic Yii page is loaded fine. When I do www.example.org/gii, I get a 404. When I go to www.example.org/index.php?r=gii, I get a 404. Why is my Gii page not found? I am using CentOS 5.6.

like image 286
user785179 Avatar asked Jun 05 '11 22:06

user785179


2 Answers

Try:

http://www.example.org/index.php/gii

It seems you have the same rules as I do for url. If http://www.example.org brings you to your main yii webapp page then the above link should work.

You were going to http://www.example.org/gii which is incorrect.

like image 87
k to the z Avatar answered Sep 20 '22 05:09

k to the z


Im using urlManager like this for gii

'urlManager'=>array(
    'urlFormat'=>'path',
    'cacheID' => false,
    //'caseSensitive' => true,
    'showScriptName' => false,
    'urlSuffix' => '/',
    'rules'=>array(
          'gii'=>'gii',
          'gii/<controller:\w+>'=>'gii/<controller>',
          'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>', 
...

and it doesn't conflict with routes for other site pages

like image 22
briiC Avatar answered Sep 19 '22 05:09

briiC