Need Help On Configs

I have decided to start porting my Yii 1 app to v2, and so I came to Gii. Confused with multiple configs (didn’t fully grasp the Guide) I cannot see where Gii gets included. According to my understanding of Guide, Gii is supposed to be available with dev enviroment with no gymnastics. It does not.

I added the line below in main-local.php but it did not work too. Anything I need to make Gii work?

Also as side question, where is UrlManager component configurations?

I use advanced template from Yii repo installed via composer.

Thanks in advance!


I’ve just started with Yii 2 as well and I haven’t encountered any problems with Gii.

Have you initialized the application with the “init” command in the Development environment? The Gii is already configured in the main-local.php (for both frontend and backend) so it shouldn’t be necessary to add any line.

It should look like this:


if (!YII_ENV_TEST) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    $config['modules']['debug'] = 'yii\debug\Module';

    $config['modules']['gii'] = 'yii\gii\Module';



Regarding the UrlManager component, I’m not that sure but I’ve placed it into common\config\main.php since I needed the same config for both frontend and backend.

Well I have all those and I had impression that it should work, however it does not. Each time I type url it redirects to google search (I guess it fails to find the page). I will check my server configurations.

Very strange!

Cool, I thought we have a pre-configured rules like Yii 1.x that is what I was trying to locate. If there is none, then I know where to add mine.

Thanks a lot!

You can alto try to run a basic application template which is simpler. It could be easier to tune the server config on it.

How are you accessing Gii (what is the address you are typing on your browser address bar)?

The address you use above depends also on how you have configured URL Manager component in your config (common or frontend).



I have not added anything yet to advanced template. Just changed database thing and tried gii.

Is there a prequisite configurations on URL or anything before it works? Guide is quiet on that!

strange thing is even http://localhost/project/frontend/web/index.php (note the added index.php) does not work and causes google search to be invoked! So am starting to suspect either my URL config or The server itself.

Anyone who is willing to share their configurations story as far as Yii2 is concerned?

I have found something that I do not understand. In Firefox (v29 Ubuntu) it does those strange things above but to my surprise it works on Chromium!

Can’t understand this :angry:

Finally I have found the problem and here it is.

Previous version of firefox used to append the "http://" part of the URL but this new version does not. And to my surprise, it will not even try the request as http rather it treats as "search query".

I do not know if it is by design or bug but I will live with it.

Thanks to all of you, friends, for lending help!