我正在尝试启动gii生成器,但由于某些原因它启动不了。我在web服务器上工作,而不是在我的本地主机上。我在配置文件中这样设置了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'],
];
}发布于 2017-06-22 01:01:04
如果您尚未为prettyUrl设置urlmanager,则应使用缺省路由sintax
https://your_app/web/index.php?r=gii 发布于 2017-08-16 21:36:00
我认为现在回答已经太晚了,但还不算太晚。如果你正在使用高级模板,那么你需要在你的backend/config/main-local.php或frontend/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', '*.*.*.*']
];
https://stackoverflow.com/questions/44677157
复制相似问题