Yii2 Advanced Template

Update: Check out our new Yii2 Developer Exchange site at http://yii2x.com. It’s devoted exclusively for Yii2 developers to make it easier to find news, tips, tutorials and extensions related to Yii2.

Initializing

After you clone a Yii2 advanced template repository to your production server, you need to run a composer update and then a production initialize:

sudo php composer.phar update
sudo php init –env=Production –overwrite=All
Yii Application Initialization Tool v1.0

Start initialization …

generate backend/web/index.php
generate backend/config/main-local.php
generate backend/config/params-local.php
generate yii
generate console/config/main-local.php
generate console/config/params-local.php
generate common/config/main-local.php
generate common/config/params-local.php
generate frontend/web/index.php
generate frontend/config/main-local.php
generate frontend/config/params-local.php
generate cookie validation key in backend/config/main-local.php
generate cookie validation key in frontend/config/main-local.php
chmod 0777 backend/runtime
chmod 0777 backend/web/assets
chmod 0777 frontend/runtime
chmod 0777 frontend/web/assets
chmod 0755 yii

… initialization completed.

Then, you need to create a new database and adjust the components.db configuration in /common/config/main-local.php accordingly.
Once complete, apply migrations with console command yii migrate.