This article mainly introduces how to send error logs by email in PHP configuration (Windows System). This article provides configuration examples and use examples, if you need it, you can refer to the following: when a serious problem occurs in the system, you need to send it to the Administrator immediately. 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