PHP configuration sends error logs by email (Windows system) and php logs. The PHP configuration sends the error log by email (in Windows). when a serious problem occurs in the system, the php log needs to be sent to the administrator immediately. You can use error_log () to send the error log by email in PHP configuration (Windows system) and php log.
When a serious problem occurs in the system, it must be immediately sent to the administrator. You can use error_log () to send errors to your mailbox by email.
Set in php. ini:
The code is as follows:
Sendmail_from = 472323087@qq.com
Then set:
The code is as follows:
Sendmail_path = "G: \ sendmail \ sendmail.exe-t"
Where: G: \ sendmail \ sendmail.exe is the mail client address.
Code:
The code is as follows:
<? Php
// Disable error display
Ini_set ('display _ errors ', 0 );
// Enable the error log function
Ini_set ('log _ errors ', 'on ');
// Display all errors
Error_reporting (-1 );
// Sending error
Error_log ('The current system is attacked, causing a fatal error', 1, '2017 @ qq.com '); // parameter 1 indicates sending an error by email
In Windows, php logs must be sent to the administrator immediately when a serious problem occurs in the system. You can use error_log ()...