Exception.chttpexception.404

My ‘config’ variable from index.php is -

$config=dirname(FILE).’/../protected/config/main.php’;

it works fine.

But I when I add a folder say dev into config/ and copy main.php into it and change ‘config’ to -

$config=dirname(FILE).’/../protected/config/development/main.php’;

it gives me an error -

exception ‘CHttpException’ with message 'Unable to resolve the request

“reports/method”.’ in

/home/foo/workspace/framework/web/CWebApplication.php:287

The permissions of config/, main.php, development/ are same.

You need to change the applications base path in the config file, probably to:




	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR.'..',



Thanks Keith, it works.

But I am confused between runtimePath and basePath variable though. Especially the parent directory of runtimePath variable.

You shouldn’t need to worry about runtimePath, it’s just where Yii stores its logs and cache data. Once basePath is set, you shouldn’t need to use it either; you would get paths using Yii::getPathOfAlias(‘path.here’).