Welcome Guest, Not a member yet? Register   Sign In
404 Page Error
#1

[eluser]Adrian Walls[/eluser]
Hi,

I my CodeIgniter app if I try to enter a URL to a method in a controller which doesn't exist I usually get the standard CI "404 Page Not Found" message displayed in my broswer window. However I have started to just see the expection message ie:

Fatal error: Cannot redeclare class ci_exceptions in c:\sites\dev\my_website\system\libraries\Exceptions.php on line 27

Is there a setting somewhere I have accidently changed which has switch the 404 Page Not Found error message off?

TIA.
#2

[eluser]Randy Casburn[/eluser]
Best way to find out is to turn on error logging in your config. Run it again. Check your log. You'll find out what it throwing the error. That will give us a starting point.

When an exception occurs that causes the exception handler to be instantiated the applictation is supposed to abort and put up one of those nice red framed error messages you see. It doesn't sound like that is happening. Then, another error fires off and tries to instantiate the class 'again'. That's when you see this error.

So the exception processing is not working properly for some reason perhaps.

Randy
#3

[eluser]Adrian Walls[/eluser]
Hi,

I have set the debug level to 4 to catch all log messages. However if I enter a URL which is not valid i.e make a call to a non-existant method in my CI controller, I only see the following two lines in the log:

DEBUG - 2008-07-23 16:30:52 --> Config Class Initialized
DEBUG - 2008-07-23 16:30:52 --> Hooks Class Initialized
#4

[eluser]Randy Casburn[/eluser]
I think there is an error (a typo) in one of your configuration files.

Randy
#5

[eluser]Adrian Walls[/eluser]
Thanks. I'll have a look through them and see if I can spot anything though had a quick look through and nothing jumps out.
#6

[eluser]Randy Casburn[/eluser]
OK...are you using any Hooks? Your log entries indicate the Codeigniter.php file gets to the point of execution that it instantiates the Hooks class and then fails. The "Config Class Initialized" shows up because it is initialized by the Hooks Class.

I could be wrong.

Randy
#7

[eluser]Adrian Walls[/eluser]
No, I am not using any hooks in the particular application.
#8

[eluser]Randy Casburn[/eluser]
OK Wallzy -- I'm trying here, but I need your help...

Quote:However I have started to just see the expection message ....

What have you changed then?

Randy
#9

[eluser]Adrian Walls[/eluser]
Sorry - I appreciate your help on this. Apologies if it hasn't come across that way.

A bit of back ground as to how I actually discovered this was a problem:
I first saw this error in Google Analytics. It was showing that some visitors to my site had been on a page which contained this error. I knew that it wasn't correct and digging around a bit I discovered that this was due to the fact they were trying to call methods which did not exist in the controller.

I had made many changes to the site over the past week. Most of these were controller, model and view (template files - I use the Smarty template engine). The only thing I can honestly remember changing that was CI related was the autoload file, I added a new config file here called metatags

Code:
$autoload['config'] = array('webapp', 'client', 'metatags');

And this is working as I expected. Sorry I can't be any more specific but that's all I changed in relation to CI files. I don't know if this is something that has become corrupted in this instance?
#10

[eluser]Randy Casburn[/eluser]
It's easy enough to troubleshoot. Comment out that line. Request a non-existent controller method. Let's see what happens.




Theme © iAndrew 2016 - Forum software by © MyBB