Search code examples
yii2localhostgii

Unable to open Gii in Yii Framework on localhost


I am trying to open the gii module on my yii based project on localhost. But its not opening. I am using virtual hosts to access the project (http://pys.dev not http://localhost/pys.dev).

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

$config['bootstrap'][] = 'gii';
$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
];
}

Solution

  • How are you trying to access it? If you enabled pretty URLs then it should be http://domain/gii if not then http://domain/index.php?r=gii

    Also check in your web/index.php that YII_ENV is set to dev