Wierd Login/Debug Issue

Hi Guys,

Got a strange issue here, it’s probably something obvious but I can’t see it right now.

When debug is on my login action works 100%. (

defined('YII_DEBUG') or define('YII_DEBUG',true);


As soon as I turn debugging off the login page displays an error when the form is submitted, as follows:


Unable to resolve the request "site/error".

My login action is pretty standard:

	public function actionIndex()




			$model=new LoginForm;

			// collect user input data




				// validate user input and redirect to the previous page if valid

				echo Yii::app()->user->returnUrl;

				if($model->validate() && $model->login()){





			// display the login form



			// display already logged in notice




Has anyone seen anything like this before, any ideas?

Thanks for your time.

There is an error somewhere it might not be in your login, but the thing is yii is not correctly configured to display the errors, please check http://www.yiiframework.com/doc/guide/1.1/en/topics.error#displaying-errors


Thanks for your time/reply.

I set-up the site/error action and view properly and the error was due to runtime/state.bin not being writeable.

I don;t know why this problem doesn’t appear when in debug mode but it seems ok now.

Thanks again.