Yii 1.1.7 - cannot find gii page

I want to use Gii in Yii. My secure /config/main.php for my first webapp has this part without comment as indicated in the Yii documentation to enable Gii (123.45.67.123 is my public IP address from the computer I'm 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 urlManager enabled in my protected / config / main.php, uncommenting 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 a Yii site, such as www.example.org, the Yii main page loads in order. When I do www.example.org/gii, I get 404. When I go to www.example.org/index.php?r=gii, I get 404. Why is my Gii page not found? I am using CentOS 5.6.

+6
source share
7 answers

Try:

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

You seem to have the same rules as for URLs. If http://www.example.org leads you to the main page of the yii web page, then the link should work.

You went to http://www.example.org/gii , which is incorrect.

+17
source

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 does not conflict with routes for other pages of the site.

+3
source

Can I place the entire urlManager block with the code @ briiC.lv? It should work, it is almost the same as mine:

 'urlManager'=>array( 'urlFormat'=>'path', 'rules'=>array( // remove gii for production: 'gii'=>'gii', 'gii/<controller:\w+>'=>'gii/<controller>', 'gii/<controller:\w+>/<action:\w+>'=>'gii/<controller>/<action>', 'site/index'=>'/', '<controller:\w+>'=>'site/<controller>', '<filter:(proj|dept)>/<id:\d+>'=>'site/', ), 'showScriptName'=>false, ), 

If it still does not work, you can also send / link it to the full main.config file.

+1
source

Have you tried with urlManager disabled? Just to see if it works gii itself

0
source

If you enabled mod rewrite and want to put the following in the htaccess file:

 php_value upload_max_filesize 1M DirectoryIndex index.php Options +FollowSymlinks RewriteEngine on # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # otherwise forward it to index.php RewriteRule . index.php 

and add the following to the 'urlManager' array in config / main.php file:

 'showScriptName'=>false, 

Will remove index.php from your URL and be sure to display the URLs as domain.com/controller/action

0
source

I was not able to access www.example.org/gii until I added the following to my vhost configuration

 <Directory /path/to/web/root> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny Allow from all </Directory> 
0
source

I had the same problem with the URL and Gii, and I found out that I wrote the wrong IP address. When I changed to the right one of Network Statistics, and then added IP to ipFilters from GII.

Hope this helps!

0
source

Source: https://habr.com/ru/post/889832/


All Articles