Php: Difference between revisions

From My Mnemonic Rhyme
Jump to navigation Jump to search
>Homaar
No edit summary
 
(No difference)

Latest revision as of 05:45, 1 September 2011

error_reporting via .htaccess

# supress php errors
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0

# general directive for setting php error level
php_value error_reporting integer

Complete error reporting — for complete PHP error logging, use an error-reporting integer value of “8191”, which will enable logging of everything except run-time notices. 1
Zend error reporting — to record both fatal and non-fatal compile-time warnings generated by the Zend scripting engine, use an error-reporting integer value of “128”.
Basic error reporting — to record run-time notices, compile-time parse errors, as well as run-time errors and warnings, use “8” for the error-reporting integer value.
Minimal error reporting — to record only fatal run-time errors, use an error-reporting integer value of “1”, which will enable logging of unrecoverable errors.


----

DEBUG

# debug php errors
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_value error_reporting 8191

Header Redirect

<?php
header("Location: http://www.example.de/");
exit;
?>

Mail Test Script

<?php

$to = "spam@tobias-weiss.org";
if( mail( $to , 'This is a test message.' , 'Is this working?' ) ) {
    echo 'Email sent.';
} else {
    echo 'Email failed to send.';
}

?>