CodeIgniter Forums
how to display errors? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: how to display errors? (/showthread.php?tid=29182)



how to display errors? - El Forum - 04-01-2010

[eluser]pck76[/eluser]
Hi All,

I've managed to update mamp php.ini to display all errors (E_ALL), and also CI error level is set to 4.

This way I'm able to see php errors, but don't see html errors. How can I solve this?

for example, my view contains
Code:
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title><?php echo $title; ?></title>
    <link href="<?= base_url();?>css/default.css" rel="stylesheet" type="text/css" /> <!-- wrong location -->

I can see the page title appearing correctly, but then the page stops processing and i get a blank page.

a) why is it stopping?
b) why doesn't it say something like "error, can't locate file css/default.css ??

thanks,
P.


how to display errors? - El Forum - 04-01-2010

[eluser]n0xie[/eluser]
Did you change the error level in your index.php to E_ALL?


how to display errors? - El Forum - 04-01-2010

[eluser]flaky[/eluser]
load the URL helper in the contructor
Code:
$this->load->helper('url');

and check that you have short tags enabled

instead of
Code:
<?= base_url();?>
[\code]

change it to this

[code]
<?php echo base_url();?>



how to display errors? - El Forum - 04-01-2010

[eluser]pck76[/eluser]
Thanks Flaky, you were right - I hadn't loaded the URL helper!

Still, I wasn't able to realize this in chrome, as it wasn't showing no errors; I've checked with safari, and that was showing an error that made me understand..


how to display errors? - El Forum - 04-01-2010

[eluser]skunkbad[/eluser]
You know, I use a custom error handler hook in all of my applications. If you are on the development server, you get to see the errors, and if you are on the production server, then it emails you the errors. It's worth checking out.