Skip to content

How To Install Yii2 Framework Basic Template on Laradock

Yuda Sukmana edited this page Dec 18, 2017 · 2 revisions
  1. Download or Clone this repo to your local machine in you working directory
git clone https://github.com/ydatech/yii2-laradock.git
  1. Create .env file (you can copy from env-example)
cd yii2-laradock
cp env-example .env
  1. run docker-compose up -d nginx mysql
  2. run docker-compose ps to see running containers, make sure that nginx mysql and workspace are up.
  3. enter workspace container docker-compose exec --u=laradock workspace bash
  4. You can now install Yii2 Framework under /var/www in workspace container.
  5. run composer create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic basic
  6. run cd basic
  7. run yii or yii_test you should see yii2 console command.
  8. Dont forget to create nginx server configuration for example : yii2-laradock/nginx/sites/basic.conf.
  9. See the sample conf from yii2-laradock/nginx/sites/app.conf.example, you can use this configuration and change the root and servername to:
    server_name basic.localhost;
    root /var/www/basic/web;
  1. Verify your installation by navigating http://basic.localhost on Google Chrome
Clone this wiki locally