Chttpexception - Unable To Resolve The Request "site/error".

Hello,

I’m trying to debug a strange error we’re having when trying to access the backend of our website:

When we goto backend.php we receive this error:

[b]CHttpException

Unable to resolve the request "site/error".

[/b]

We are running a Linux machine, using PHP 5.3.1

The only thing I can think of is that it could be htaccess or permissions related. Here’s what’s in our Htaccess file:


AddDefaultCharset utf-8

Options +FollowSymLinks

IndexIgnore /

RewriteEngine on

RewriteRule ^backend backend.php

If a directory or a file exists, use it directly.

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

Otherwise forward it to index.php.

RewriteRule . index.php

RewriteRule \.svn/ - [F]


Any help would be greatly appreciated, so far googling hasn’t helped…

Thanks!

There are two things:

[list=1]

[*]you have got some error which causes error page to show. You could check application.log for detailed info.

[*]you have misconfigured error handling. Read http://www.yiiframework.com/doc/guide/1.1/en/topics.error. There is by default ‘errorHandler’ component which points to controller/action that handles errors:


return array(

    ......

    'components'=>array(

        'errorHandler'=>array(

            'errorAction'=>'site/error',

        ),

    ),

);



but you do not have such controller/action in you application.

[/list]

Thank you for your reply. So the latest error application.log is dated on 2/13/13, which seemed to be related to an issue we already fixed.

Basically, we’re just trying to setup a staging instance of a website that’s already working properly on the live server. For whatever reason, the Yii Framework has been giving us trouble since we’ve moved it to our Linux server. We’ve had to 777 the runtime directory (Which I hate doing) just to get the front-end working. Now we’re stuck trying to get the back-end working. Maybe some directory in the back-end has to be 777?

you do not need 777 permissions. you can change owner (or group) and specific rights so that user on which privileges webserver is working has access and can write in ‘protected/runtime’ and ‘assets’ directories of every application. Yii needs this write access to modify log files, cache, etc.

if you have problems after moving from windows to linux most common reason is case sensitivity of class names (autoloader looks for file with name exactly like classname)

Hi Red, since I’m new to the Yiiframework, can you direct me to where I should check for case sensitive class names? As for permissions, the owner and group are using our standard user settings on our server. Do they need to be set to something like “apache”?

hard to tell, because they can be only in your own code. But maybe problem is different, this was only suggestion that it is common problem when application works on windows and does not on linux.

apache or rather www-data. if you are using PHP as mod_php you should check what is the user assigned to apache2 processes. you get this under linux by running: ps aufx