Error checking

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello all,
I have a classic problem: things run properly on my test server but don't  
work on the live server (different PHP version, different master Apache  
config, etc...) which I do not admin. In particular, for 'security reason'  
the access to the error.log file has long been disabled and I don't get any  
message on screen. Things just don't happen the way they should.

I've tried putting various takes on this in my .htaccess to no avail:
    php_flag display_errors on
    php_value error_log /home/dargaud/logs/error.log    # Nothing there
    php_value error_reporting E_ALL
    php_flag html_errors on
    php_flag log_errors on
    php_flag track_errors on

What else can I try to troubleshoot issues without admin rights on the  
server ?
Guillaume Dargaud

Re: Error checking

May this help?

Quoted text here. Click to load it

function defaultErrorHandler($errno, $errstr ,$errfile, $errline,
$errcontext ) {

     if ( false === strpos( $errfile, "var: Deprecated" ) ) {

    $encodedErrno         =  htmlentities("" . $errno);
    $encodedErrfile     =  htmlentities("" . $errfile);
    $encodedErrstr         =  htmlentities("" . $errstr);
    $encodedErrline     =  htmlentities("" . $errline);
    $encodedErrcontext     =  htmlentities("" . $errcontext);

    echo "<block class='errroReportStyle'>";
    echo "error [$encodedErrno :: $encodedErrstr] ";
    echo "<br />In [$encodedErrfile :: $encodedErrline] ";
    echo "<br />context: $encodedErrcontext";
    echo "<hr />";
    echo "</block>";


// set up the error handler
Set_error_handler( 'defaultErrorHandler' );

function defaultAssertHandler($file, $line, $code)
    addErrorMessage( kHardError, "[AH1-1]", "Internal error [" . $file .
":" . $line . ":".$code . "]" );
       echo "<hr>Assertion Failed:File '$file'<br />Line '$line'<br /
Quoted text here. Click to load it
    // exit;

// Set up the callback
assert_options(ASSERT_CALLBACK, 'defaultAssertHandler');

Re: Error checking

An extension of assert() ? Sure that can help !
I was looking for a way to simply see the error messages, but since I have a  
vague idea of where they are happening I can wrap some asserts over there.
Guillaume Dargaud

Site Timeline