Cara Instalasi Yii Framework

Tutorial Yii Framework bagian 2 – Instalasi Yii Framework

OK pada post sebelumnya mengenai Yii Framework kita sudah mengenal dan membahas keunggulan dari Yii framework, pada pembahasan kali ini kita akan melakukan instalasi yii framework. Langkah-langkahnya adalah sebagai berikut:

  1. Download Yii framework di sini http://www.yiiframework.com/
  2. Extract file hasil download di folder htdocs – (asumsi sudah terinstal XAMPP).
  3. Struktur folder anda contohnya akan seperti berikut – X:\xampp\htdocs\yii
  4. Buka command prompt – bisa melalui shortcut win key + r -> ketik cmd
  5. ketik X: lalu enter
  6. ketik cd X:\xampp\htdocs\yii\framework  -> enter
  7. ketik yiic webapp ../htdocs/namaaplikasi
  8. akan muncul pertanyaan, Create a Web application under ‘X:\xampp\htdocs\namaaplikasi’? (yes|no) : ketik yes
  9. Bisa anda lihat di win explorer pada folder htdocs telah terbuat sebuah folder namaaplikasi yang berisi framework yii
  10. Struktur folder yii
    namaaplikasi/ 
       index.php                 Web application entry script file
       index-test.php            entry script file for the functional tests
       assets/                   containing published resource files
       css/                      containing CSS files
       images/                   containing image files
       themes/                   containing application themes
       protected/                containing protected application files
          yiic                   yiic command line script for Unix/Linux
          yiic.bat               yiic command line script for Windows
          yiic.php               yiic command line PHP script
          commands/              containing customized 'yiic' commands
             shell/              containing customized 'yiic shell' commands
          components/            containing reusable user components
             Controller.php      the base class for all controller classes
             UserIdentity.php    the 'UserIdentity' class used for authentication
          config/                containing configuration files
             console.php         the console application configuration
             main.php            the Web application configuration
             test.php            the configuration for the functional tests
          controllers/           containing controller class files
             SiteController.php  the default controller class
          data/                  containing the sample database
             schema.mysql.sql    the DB schema for the sample MySQL database
             schema.sqlite.sql   the DB schema for the sample SQLite database
             testdrive.db        the sample SQLite database file
          extensions/            containing third-party extensions
          messages/              containing translated messages
          models/                containing model class files
             LoginForm.php       the form model for 'login' action
             ContactForm.php     the form model for 'contact' action
          runtime/               containing temporarily generated files
          tests/                 containing test scripts
          views/                 containing controller view and layout files
             layouts/            containing layout view files
                main.php         the base layout shared by all pages
                column1.php      the layout for pages using a single column
                column2.php      the layout for pages using two columns
             site/               containing view files for the 'site' controller
                pages/           containing "static" pages
                   about.php     the view for the "about" page
                contact.php      the view for 'contact' action
                error.php        the view for 'error' action (displaying external errors)
                index.php        the view for 'index' action
                login.php        the view for 'login' action

Permasalahan yang sering muncul

Terkadang saat instalasi ditemukan error seperti berikut:

“php.exe is not recognized as an internal or external command”

cara menanganinya cukup mudah dengan mengedit file yiic.bat melalui notepad, kemudian tambahakan line berikut (yang diberi bold)


@setlocal

set YII_PATH=%~dp0

cd X:\xampp\php\

if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe

"%PHP_COMMAND%" "%YII_PATH%yiic" %*

@endlocal

kemudian save dan jalankan ulang perintah yicc untuk instalasi.

You may also like...

1 Response

  1. January 31, 2014

    […] Selanjutnya kita akan membahas mengenai cara instalasi yii framework […]

Leave a Reply

Your email address will not be published. Required fields are marked *