możesz skorzystać z funkcji error_log(), wtedy wskazujesz gdzie mają pójsć komunikaty o błędach (trzeba ją wywołać przed error_reporting()
druga opcja to set_error_handler()
function moja_obsluga_bledu($aErrorNo, $aErrorStr, $aFile, $aLine, $aContext){
$headers = "From: [email protected]\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$body = "Numer bledu: ".$aErrorNo."\nTresc bledu: ".$aErrorStr."\nPlik wystapienia bledu: ".$aFile."\nLinia wystapienia bledu: ".$aLine."\nContext: ".$aContext;
mail("[email protected]", "Błąd na stronie strona.pl", $body, $headers);
header('Location: error.php');
exit;
}
set_error_handler("moja_obsluga_bledu");
error_reporting(2048);
po tej funkcji błąd zostanie wysłany na maila a nie wyświetli się na stronie. no i stronka zostanie przekierowana na stronę error.php