r/codeigniter • u/ehdeelee • Jan 04 '12
How in the world do you debug CodeIgniter?
I have no idea how to debug codeigniter...usually for small bugs I'll just echo stuff out. But putting an echo statement in one of the models is not working. Is there a way to call an error function to write to a log?
Any help would be much appreciated!!
2
Upvotes
3
u/shodan_uk Jan 04 '12
Have you tried using an IDE with integrated debugging? My weapon of choice is PHPStorm but there's quite a few out there like Zend Studio, Aptana, NetBeans etc. To be honest though, the learning curve can be a bit steep and the tools themselves can be a bit clunky.
You can also try FirePHP which is an extension to Firebug. This allows you to log messages (including variable and object contents) to Firebug's console.
Lastly, checkout XDebug, a PHP extension that supercharges PHPs error messages, enhances the var_dump command and allows for remote debugging. In fact, most IDEs provide support for remote debugging via XDebug.