Getting PHP Errors

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
damon

Getting PHP Errors

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Getting PHP Errors

Post by calguy1000 »

in cms 1.2, display errors is turned on, and error reporting is set to E_ALL when debug mode is on.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Getting PHP Errors

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
damon

Re: Getting PHP Errors

Post 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.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Getting PHP Errors

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
damon

Re: Getting PHP Errors

Post by damon »

Beautiful!  I'd spaced out re-setting 'display_errors'.  D'oh!
Post Reply

Return to “Developers Discussion”