Monday, September 1, 2008

Kohanaphp first touch

After a year using CodeIgniter php framework, two weak ago i found the other swift and lightweight framework kohanaphp. This framework was born from CodeIgniter forum with name bluefame before change the name to kohanaphp, CodeIgniter user would be familiar too with this framework concept, except the code it use php5 strict.
This is my little experiment using kohanaphp, so what we need to using this framework absolutely Webserver support Php5 (ex: Apache). Fisrt i want to use this framework just for one location, this is my step by step (FYI i use WAMP server) :
  1. download kohanaphp from http://kohanaphp.com
  2. extract kohanaphp to your web server directory (C:\wamp\www\ so become C:\wamp\www\kohanaphp)
  3. edit C:\wamp\www\kohanaphp\application\config\config.php
    $config['site_domain'] = '/kohanaphp/';
    to
    $config['site_domain'] = 'localhost/kohanaphp/';
  4. browse to address http://localhost/kohanaphp/
From here you must get the Welcome page from kohanaphp, it's done. Now we will try to use one kohanaphp system for more than 3 site (i will use location directory for kohanaphp1, kohanaphp2, kohanaphp3). This my step by step:
  1. extract kohanaphp to your directory (c:\wamp\www\ so become c:\wamp\www\kohanaphp)
  2. move c:\wamp\www\kohanaphp\system to c:\kohana\system
  3. copy c:\wamp\www\kohanaphp to c:\wamp\www\kohanaphp1
  4. copy c:\wamp\www\kohanaphp to c:\wamp\www\kohanaphp2
  5. copy c:\wamp\www\kohanaphp to c:\wamp\www\kohanaphp3
  6. edit c:\wamp\www\kohanaphp\index.php, c:\wamp\www\kohanaphp1\index.php, c:\wamp\www\kohanaphp2\index.php, c:\wamp\www\kohanaphp3\index.php
    $kohana_system = 'system'
    to
    $kohana_system = 'c:\kohana\system'
  7. edit file c:\wamp\www\kohanaphpx\application\config\config.php, x can be '', 1, 2, 3
    $config['site_domain'] = '/kohana/';
    to
    $config['site_domain'] = 'localhost/kohanax/';
  8. now browse your link http://localhost/kohanaphpx, and it's done
  9. now we have 4 kohanaphp apllication using 1 kohanaphp system
thx

No comments: