Yii2-app-advanced template

In this guide to install and prepare the advanced template app there are some point that I don’t understand under Preparing application section:


[*]Point 1 :

what does that mean?(Does it mean I should run the on the developpement computer the first command, and the second command on my vps(production server)? what if I wanna test the app in production(showing the debug toolbar), will it show in the production which I initiated with the second command?

[*]Point 4 :

[*]Where is the apache configuration :

supposed to be, in the root folder of my account or I have to edit apache httpd.conf to add that?

[*]Point 5:



[*]Should that be done when developing only or when deploying?

[*]should it be done on the local computer or production?



  1. No. Non-interactive mode is for automation scripts such as deployment bash-scripts. The difference is that you’re answering for all questions right away instead of typing answers after command is executed. That’s it.

  2. Yes, you have to edit httpd.conf. If you want single entry point, start with basic project template.

  3. In case you don’t have dedicated domain already pointed there which is usually the case when developing.

I think you need to learn a bit about how the Apache server works (assuming your using Apache). How to setup virtual hosts. What the hosts file is for… ect…

You don’t have to set any of those up, if your just wanting to mess around locally. If your asking the questions that you asked, I doubt your ready to make a full-fledged site for the public…

You don’t have to setup any virtual hosts or edit your host file. You just won’t have any nice domain alias for your site, it will be like: http://localhost/your-yii-app/web/index.php

If your using advanced: http://localhost/your-yii-app/frontend/web/index.php or http://localhost/your-yii-app/backend/web/index.php

You can set virtual hosts to make it nicer, like: http://client1-site.dev - We usually use the same domain as the real one, only use .dev instead of .com or .net, etc. Then your hosts file, you map the domain to yourself: client1-site.dev

You can setup sub domains for advanced and have these paths, using virtual hosts and the host file:




However, none of it is required!

Just open Terminal (or command prompt) and navigate to your web directory…

Mac XAMPP: /Applications/XAMPP/xamppfiles/htdocs/

Windows WAMP: C:\wamp\www <-- i think?

Then run composer to download Yii as the docs say.

By default, it puts it into "yii2-basic" or "yii2-advanced". So you go to your web browse: http://localhost/yii2-basic/web

You can use it perfectly fine as localhost

The advanced app requires you to run init, so it can merge private files into the app. This is for shared projects, or swapping configs between your local server, testing server, production server.

You open Terminal (or command prompt) and navigate to your yii2 app. Then run init. If your on a mac, you have to put ‘./init’. The ./ tell it to execute as a script.

Fun fact. There is an app that will map "watever.dev" to a folder named "whatever" in your web root. Saving you from making all the vhost edits. I forget it, but will update this later with the name.