2017-06-21 55 views
0

我試圖啓動gii生成器,但由於某種原因無法啓動。我在web服務器上工作,而不是在我的本地主機。 我設置了GII在配置文件中是這樣的:無法啓動gii生成器

if (YII_ENV_DEV) { 
    // configuration adjustments for 'dev' environment 
    $config['bootstrap'][] = 'debug'; 
    $config['modules']['debug'] = [ 
     'class' => 'yii\debug\Module', 
    ]; 

    $config['bootstrap'][] = 'gii'; 
    $config['modules']['gii'] = [ 
    'class' => 'yii\gii\Module', 
    'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20', '195.178.49.18'], 
    ]; 
} 
+0

你得到任何錯誤? – lalithkumar

+0

我在瀏覽器中輸入以下鏈接 - https://「project domain」/index.php?r=gii - 然後進入我的項目頁面,其中顯示「找不到頁面」。 –

+0

https://「project domain」/index.php/gii ..如果你試試這個也是同樣的信息,你會得到什麼? – lalithkumar

回答

0

如果您還沒有設置好的用於prettyUrl您應該使用默認路由sintax

https://your_app/web/index.php?r=gii 
0

我認爲它現在太晚了要接聽urlmanager ,但還不算太晚。 如果您使用高級模板,那麼您需要在您的backend/config/main-local.phpfrontend/config/main-local.php中添加您的IP。 基本上你必須添加你的ip兩端。 如果你不確定你的IP,那麼你可以使用'*'來允許所有的IP(不要忘記在完成工作後改變它),例如 - >'allowedIPs' => ['127.0.0.1', '::1', '192.168.33.1', '*.*.*.*']

$config['modules']['gii'] = [ 
 
     'class' => 'yii\gii\Module', 
 
     'allowedIPs' => ['127.0.0.1', '::1', '*.*.*.*'] 
 
     ];