First day with Yii in windows


I have encountered and solved an error on my first day with Yii framework in windows.
The error is like following


Warning: require_once(C:\wamp\www\yiidemo/../yii.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in C:\wamp\www\yiidemo\index.php on line 12

Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'C:\wamp\www\yiidemo/../yii.php' (include_path='.;C:\php\pear') in C:\wamp\www\yiidemo\index.php on line 12

Here is my index.php file

index.php

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require_once($yii);
Yii::createWebApplication($config)->run();

The problem is in the 4th line:

$yii=dirname(__FILE__).'/../yii.php';

>> change to 

$yii='C:\wamp\www\yiiroots\framework\yii.php';

Here, 
yiiroots = your unzipped yii framework directory. initial name was something like: yii-1.1.13.e9e4a0

i don’t know if its the right solution, but worked in my case, at least for a while 🙂

Another word is worth to mention, I have already set my Environment variable path: C:\wamp\bin\php\php5.3.13