Latest From The Blog

Service announcements and product updates from the Mad Capsule team

James

Debugging Cake PHP Applications

April 24th, 2009 by James in php

A common question new starters to CakePHP ask is regarding debugging. Many users start off with basic scaffolding and confronted with the uninformative error .... Not Found The requested URL /index.php was not found on this server. This is because your CakePHP application is set to production mode. In production mode you would not want your visitors and clients seeing detailed error reports, it would worry them.

To find out what the actual problem is open up file app/config/core.php and find line 45(ish) and you will see the following .... Configure::write('debug', 0); Change the above value from 0 to either 1, 2 or 3 and you will get a much more helpful error message.

We recommend you set it to 2. Direct from the CakePHP comments itself; here is an explanation of each debug level... * Development Mode: * 1: Errors and warnings shown, model caches refreshed, flash messages halted. * 2: As in 1, but also with full debug messages and SQL output. * 3: As in 2, but also with full controller dump.

It is worth noting that when debug level is set to anything other than production mode (0), any 'flash' messages and redirects you have will not redirect automatically, you must click the link to forward on.

comments powered by Disqus

OUR AUTHORS

Mark
Mark

I like the Sea, Monkeys, the Internet and sun. I don't like olives

James
James

Less QQ more pew pew

Israel
Israel

I love time travel, infact I'm writing this from the 1920s

CATEGORIES