I wants to know about log_errors in php(error messages in php) with some example codings I need to know some phpcoding when an error occurs in php page, I need to set the errormessages and i want to write that error messages in the seperate file,not in the browser
My reply in your other thread is bout storing the errors instead of dislpaying them. Here's the code again: set_error_handler("my_error_handler"); function my_error_handler ($errNo, $errString, $errFile, $errLine) { // if you don't allready store the error in the error log: error_log("[" . $errNo . "] " . $errString. ": in " . $errFile . " @line " . $errLine); // now dislpay a custom error message: die("Something went wrong processing this page, the webmaster has been informed"); } PHP: The error_log function writes the error to the server log. If you make some changes to the functio, you can make it to write the error to a different file. This is how you add data to file in php: $fp = fopen("myfile.log", "a+"); fwrite($fp, $message); fclose($fp); PHP: