CodeIgniter Forums
Help with displaying error messages - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Help with displaying error messages (/thread-53341.html)



Help with displaying error messages - El Forum - 07-19-2012

[eluser]nydeveloper[/eluser]
I made some changes to a very large model file, and didn't back the original up first (stupid, I know)...

At this point I'm getting a blank page (in Firefox) or a server error (in Chrome) when trying to load what were several previously working functions within this model.

How do I get some relevant PHP error messages to display?

Here are some code snippets from my configuration files:

index.php


Code:
/*
*---------------------------------------------------------------
* PHP ERROR REPORTING LEVEL
*---------------------------------------------------------------
*
* By default CI runs with error reporting set to ALL.  For security
* reasons you are encouraged to change this to 0 when your site goes live.
* For more info visit:  http://www.php.net/error_reporting
*
*/
error_reporting(E_ALL);



config.php

|--------------------------------------------------------------------------
Code:
| Error Logging Threshold
|--------------------------------------------------------------------------
|
| If you have enabled error logging, you can set an error threshold to
| determine what gets logged. Threshold options are:
| You can enable error logging by setting a threshold over zero. The
| threshold determines what gets logged. Threshold options are:
|
| 0 = Disables logging, Error logging TURNED OFF
| 1 = Error Messages (including PHP errors)
| 2 = Debug Messages
| 3 = Informational Messages
| 4 = All Messages
|
| For a live site you'll usually only enable Errors (1) to be logged otherwise
| your log files will fill up very fast.
|
*/
$config['log_threshold'] = 4;


My log file output is pretty much useless. Any ideas here are appreciated.


Help with displaying error messages - El Forum - 07-19-2012

[eluser]Aken[/eluser]
Turn error displaying on in php.ini


Help with displaying error messages - El Forum - 07-20-2012

[eluser]nydeveloper[/eluser]
I should have mentioned that I had already done this, and it did not change anything. Below is an excerpt from my php.ini file.

Code:
; Common Values:
;   E_ALL & ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
;   E_ALL & ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL | E_STRICT

; This directive controls whether or not and where PHP will output errors,
; notices and warnings too. Error output is very useful during development, but
; it could be very dangerous in production environments. Depending on the code
; which is triggering the error, sensitive information could potentially leak
; out of your application such as database usernames and passwords or worse.
; It's recommended that errors be logged on production servers rather than
; having the errors sent to STDOUT.
; Possible Values:
;   Off = Do not display any errors
;   stderr = Display errors to STDERR (affects only CGI/CLI binaries!)
;   On or stdout = Display errors to STDOUT
; Default Value: On
; Development Value: On
; Production Value: Off
; http://php.net/display-errors
display_errors = On

; The display of errors which occur during PHP's startup sequence are handled
; separately from display_errors. PHP's default behavior is to suppress those
; errors from clients. Turning the display of startup errors on can be useful in
; debugging configuration problems. But, it's strongly recommended that you
; leave this setting off on production servers.
; Default Value: Off
; Development Value: On
; Production Value: Off
; http://php.net/display-startup-errors
display_startup_errors = On



Help with displaying error messages - El Forum - 07-23-2012

[eluser]nydeveloper[/eluser]
I've hit a dead end on this. Nothing seems to work. Has anyone else seen this problem, even after enabling everything described above?


Help with displaying error messages - El Forum - 07-23-2012

[eluser]NotDior[/eluser]
Do you have access to a command line? If so try and do a php -l YOURFILENAME.PHP that will do a lint check on it and make sure syntax is correct on it. I've ran into the blank screen before and sometimes the lint check helps out.

Other than that I'm not sure.


Help with displaying error messages - El Forum - 07-23-2012

[eluser]prasie[/eluser]
Code:
<?php

/*
*---------------------------------------------------------------
* APPLICATION ENVIRONMENT
*---------------------------------------------------------------
*
* You can load different configurations depending on your
* current environment. Setting the environment also influences
* things like logging and error reporting.
*
* This can be set to anything, but default usage is:
*
*     development
*     testing
*     production
*
* NOTE: If you change these, also change the error_reporting() code below
*
*/
ini_set('pcre.backtrack_limit',1000000);
date_default_timezone_set('Asia/Jakarta');
//define('ENVIRONMENT', 'production');
define('ENVIRONMENT', 'development');
/*
*---------------------------------------------------------------
* ERROR REPORTING
*---------------------------------------------------------------
*
* Different environments will require different levels of error reporting.
* By default development will show errors but testing and live will hide them.

find this code should be var/www/html or your current folder

//define('ENVIRONMENT', 'production');
define('ENVIRONMENT', 'development');

production means not showing error and ommit notice or warning
development means showing all error message

this file name index.php



Help with displaying error messages - El Forum - 07-23-2012

[eluser]nydeveloper[/eluser]
thanks prasie! That worked!! Smile