Tip #3 - Configuring a Kohana website/application


0. Download Kohana from the Kohana website: http://www.kohanaphp.com/download.
1. Extract the downloaded into a directory accessible to your web server (let's say Your_DocumentRoot_Directory/k for the purposes of this tutorial)
2. Ensure that your web server has read/write/execute access to all files within your Kohana directory (k). If you are on Linux, you may need to do something to this effect: chmod -R 777 Your_DocumentRoot_Directory/k, e.g chmod -R 777 /var/www/k. Warning: 777 is WAY too liberal and should only be used in a development environment to avoid security problems.
3. Point your web browser to your Kohana installation directory:
    http://localhost/k/
   You should see a page with Kohana's environment tests. Make sure everything is labelled pass before you proceed to the next step by ensuring that you do whatever is required to pass all the tests. This could be giving your web server the appropriate permissions or upgrading your PHP version to PHP 5.2 or above, and installing any required PHP extensions, e.g. reflection. Refresh your browser window to ensure you have the required passes (hit F5 button on most browsers).
4. Once all the tests in the last step have been passed, remove the install.php located in Your_DocumentRoot_Directory/k and then refresh your browser once more. You should now see the lovely Kohana Welcome Page! Congratulations! Your Kohana installation is ready.
5. Now open the Your_DocumentRoot_Directory/k/application/config/config.php and change the following values:
    $config['site_domain'] = 'your_domain_here'; //optionally you can specify the web path on a local server, e.g. /k/
    $config['index_page'] = 'index.php';
You can already start writing code on this beautiful framework. Before I write any code, however, I like to do the following optional steps to ensure my environment is setup right.
6. If you are going to be using a database for your applocation, mosy on over to Your_DocumentRoot_Directory/k/system/database.php and plonk in your own database connection values.
7. Open the file Your_DocumentRoot_Directory/k/system/routes.php change
    $config['_default'] = 'welcome'; to
    $config['_default'] = 'index';
    This sets my default controller from Kohana's welcome controller (you can see this under Your_DocumentRoot_Directory/k/application/controllers/welcome.php) to index, which I will define at Your_DocumentRoot_Directory/k/application/controllers/index.php.

Good to go!
Now you can begin coding in earnest. You will find more information about Kohana over at http://www.kohanaphp.com/
   
Well, that's all I have time for today folks. Let's meet again same time (when you next take a break) and see what you can do.