Tuesday, September 22, 2009

Codeigniter and PHP Parse Errors

I'm learning the CodeIgniter php framework.

By default, CI disables php display errors for security purposes. So, if you've missed a semicolon, a curly brace or whatever, you get a blank page. Actually, that's all you'll get in anything that relies on that controller, model, or view. Less than helpful for a novice programmer.

Finally, I figured it out. I'm a little embarrassed about the simplicity of it.

In index.php do this:

ini_set('display_errors', 1);

And you'll get those wonderful parse errors in CodeIgniter instead of a completely blank page. Line numbers, file names, and all.

No comments:

Post a Comment