Wednesday, July 20, 2016

001 Install Yii versi 2

composer = management tool utk dependency, jadi bisa install dependency otomatis bila tidak ada.

install dari yii-advanced-app-2.0.9.tgz

extract

copy semua ke folder www

buka cmd, jalankan = php         init
contoh:
/xampp/php/php.exe        /Users/user/Documents/www/yii2/yii-advanced-app-2.0.9/advanced/init

pilih dev

create database, konfigure dbname dan password di common/config/main-local.php

isi di \xampp\apache\conf\extra\httpd-vhosts.conf


  
       ServerName frontend.dev
       DocumentRoot "/path/to/yii-application/frontend/web/"

      
           # use mod_rewrite for pretty URL support
           RewriteEngine on
           # If a directory or a file exists, use the request directly
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           # Otherwise forward the request to index.php
           RewriteRule . index.php

           # use index.php as index file
           DirectoryIndex index.php

           # ...other settings...
      

  


  
       ServerName backend.dev
       DocumentRoot "/path/to/yii-application/backend/web/"

      
           # use mod_rewrite for pretty URL support
           RewriteEngine on
           # If a directory or a file exists, use the request directly
           RewriteCond %{REQUEST_FILENAME} !-f
           RewriteCond %{REQUEST_FILENAME} !-d
           # Otherwise forward the request to index.php
           RewriteRule . index.php

           # use index.php as index file
           DirectoryIndex index.php

           # ...other settings...
      

  


restart apache, run : http://frontend.dev
ada 2 webroot: http://frontend.dev dan http://backend.dev


No comments:

Post a Comment