If you are getting a 404 not found error when trying to access gii, you probably don’t have gii set up in your config. This may happen if you initialize your advanced template in prod environment instead of dev.
To activate Gii, modify your web/index.php file as follows:
Change: defined(‘YII_ENV’) or define(‘YII_ENV’, ‘prod’);
To: defined(‘YII_ENV’) or define(‘YII_ENV’, ‘dev’);
Add the following:
- if (YII_ENV_DEV) {
- $config['bootstrap'][] = 'gii';
- $config['modules']['gii'] = [
- 'class' => 'yii\gii\Module',
- 'allowedIPs' => ['XXX.XX.XX.XX']
- ];
- }
Replace XXX.XX.XX.XX with the IP address you are accessing the gii module from.
whatismyip.com