xxxxxxxxxx
// Add these lines somewhere on top of your PHP file:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
xxxxxxxxxx
//PHP functions
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
//.htaccess
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.logphp_value error_log /home/path/public_html/domain/PHP_errors.logphp_value error_log /home/path/public_html/domain/PHP_errors.log
xxxxxxxxxx
<?php
error_reporting(E_ALL ^ E_NOTICE);
$id = $_GET['id'];
switch ($id) {
case 1: $url = 'http://faradars.org/'; break;
case 2: $url = 'http://google.com/'; break;
case 3: $url = 'http://bing.com/'; break;
}
if (is_null($url)) {
exit('ERROR: Invalid destination!');
}
$headers_sent = headers_sent($file, $line);
if ($headers_sent) {
echo 'Headers are already sent!<br/>';
echo 'File: '.$file.'<br/>';
echo 'Line: '.$line.'<br/>';
}
header("Location: $url");
exit();
echo 'Success!';
xxxxxxxxxx
you could try to change this lines to get more information from php:
; 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.
display_startup_errors = on
; when php displays or logs an error, it has the capability of formatting the
; error message as html for easier reading. this directive controls whether
; the error message is formatted as html or not.
; note: this directive is hardcoded to off for the cli sapi
html_errors = only
xxxxxxxxxx
you could try to change this lines to get more information from php:
; 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.
display_startup_errors = on
; when php displays or logs an error, it has the capability of formatting the
; error message as html for easier reading. this directive controls whether
; the error message is formatted as html or not.
; note: this directive is hardcoded to off for the cli sapi
html_errors = on
you can display php errors by server directly
xxxxxxxxxx
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
?>
<?php
error_reporting(E_ALL & ~E_NOTICE); // if don't want to see notice
// Or
error_reporting(E_ALL);
?>
//.htaccess
php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on
php_flag log_errors on
php_value error_log /home/path/public_html/domain/PHP_errors.log