Page 1 of 1

Getting PHP Errors

Posted: Sun Nov 18, 2007 4:55 pm
by damon
I'm a seasoned PHP developer just starting on CMSMS development.  One of my biggest gripes so far is the complete lack of error reporting.  I understand that end users don't need to see PHP errors, but I'd think that by setting $config['debug'] = true; I'd get php errors.  Instead the page dies silently and I'm forced to debug line by line. 

I'm sure I could pull apart the engine(s) and get errors out (perhaps change all the silenced @functions to functions), but I'm hoping there is an easier way.

Re: Getting PHP Errors

Posted: Sun Nov 18, 2007 4:58 pm
by calguy1000
in cms 1.2, display errors is turned on, and error reporting is set to E_ALL when debug mode is on.

Re: Getting PHP Errors

Posted: Sun Nov 18, 2007 4:59 pm
by calguy1000
and if you doubt that they are, you can always add the appropriate lines to config.php temporarily and turn it on yourself.

Re: Getting PHP Errors

Posted: Sun Nov 18, 2007 5:06 pm
by damon
Thanks calguy!  I'm using 1.1.4.1 (I didn't make the decision here); is there a way to do it there?

Also, I've tried adding error_reporting(E_ALL) a bunch of places, but to no avail.  Admittedly I'm too busy getting stuff done to really dive into how the system works.

Thanks for the quick reply all the same.

Re: Getting PHP Errors

Posted: Sun Nov 18, 2007 5:22 pm
by calguy1000
@ini_set('display_errors',1);
@error_reporting(E_ALL);

Add that into the config.php

Now, if you're still getting a blank page, then your server may not allow you to do an ini_set, in which case you'll have to look at your web control panel, or find some other way of getting the httpd errors.

Re: Getting PHP Errors

Posted: Sun Nov 18, 2007 5:25 pm
by damon
Beautiful!  I'd spaced out re-setting 'display_errors'.  D'oh!