I’m new to Kohana, making this tutorial just want to do something for the community. Please let me know, if you found any mistakes. Ok, let’s cut to the chase.
I suppose you have your server installed, if not I recommand AppServ. It’s better to use the latest version of Kohana from SVN, so you might need TortoiseSVN. I create a folder called Kohana in my webroot, check out the truck folder from SVN, it’s quite easy to do it, right click, select SVN Check…

Type http://svn.kohanaphp.com/trunk in URL of repository, click ok, and wait for the download.


And then you will have three folders: application, modules and system; and three files: index.php, kohana.png, Kohana License.html. To see if Kohana is installed properly, type localhost/Kohana, you will see the welcome page:

Now you may want to do some configuration. Open config.php in /application/config/ folder, the first setting is the site domain, we are using localhost here, so just leave it as ‘/kohana/’. For the second one site protocol, we mostly use ‘http’. That’s all what we do for this moment.
I would like to do some test now. Create a test.php file in /application/controllers/, type in the fellowing codes:
<?php
/**
* Test controller
*/
class Test_Controller extends Template_Controller
{
function __construct()
{parent::__construct();
//Generate system information, you should try to comment this line to see what will the page be.
$this->profiler = new Profiler;
}function index()
{
//Set the page title.
$this->template->title = ‘Test Page’;
}
}
?>
We also need to create a template.php in /application/views/, it looks like this:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en” lang=”en”><head>
<title><?php echo $title ?></title>
<body>
<h2><?php echo $title ?></h2>
</body>
</html>
Back to the blowser, we have visited localhost/kohana, and now we go to localhost/kohana/index.php/test, you should have a page like this:

There are only two parts in this page, the first one is the title of the page, setting by ‘$this->template->title = “Test Page”;’ and the second part is a table of some system information generated by the profiler library: ‘$this->profiler = new Profiler;’
Ok, that’s all, for further issue, you should keep an eye on my blog and Kohana official website.
Feel free to visit our Forum, subscribe our RRS Feed for news updates, and follow us on Twitter.
ITech Theme: Free WordPress Theme For Gadgets And Tech Blogs
BlackNWhite Theme Update 05/November/2009
7 Responses to “Install Kohana on Windows”
thx for tutorial, I have error when I tried your example, I used xampp for server php, when I write localhost/kohana on mybrowser it works like yours, can you help me?(I tried your example test.php and template.php and error like this : “Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\Kohana\application\controllers\hello.php on line 14″)
is xampp support to php5(it is used php 5.2.5)?
As I know, xampp support php5.
You said you try my example test.php and template.php and error is from a “hello.php” controller, I guess you may have some naming problem with files, try to have a look with all the file names, the names of controllers and the names of views, hope this helps.
I had exactly the same problem. You should change “Test page” to “Test page” in test.php
Change “Test page” to “Test page” in test.php?
What’s the different?
The Different is in the “”, it can’t be italic…
Did I set it to italic? I don’t think so. But I think it’s better to be ‘ ‘ rather than ” “, I’ve corrected my post already.
It is the same think still…
The problem is the quotes anyhow, nasty html stylizing ;)
profiler = new Profiler;
}
function index() {
//Set the page title.
$this->template->title = ‘Test Page’;
}
}
?>