PHP配置把错误日志以邮件方式发送方法(Windows系统),php日志_PHP教程

WBOY
Libérer: 2016-07-13 09:48:46
original
970 Les gens l'ont consulté

PHP配置把错误日志以邮件方式发送方法(Windows系统),php日志

当系统发生了很严重的问题,需要立刻发送给管理员。可以通过 error_log() 将错误以邮件形式发送到邮箱。

在 php.ini 中设置:
复制代码 代码如下:
sendmail_from = 472323087@qq.com

然后设置:
复制代码 代码如下:
sendmail_path = "G:\sendmail\sendmail.exe -t"

其中:G:\sendmail\sendmail.exe 是邮件客户端的地址。

 代码:

复制代码 代码如下:
//关闭错误显示
ini_set('display_errors', 0);
//开启错误日志功能
ini_set('log_errors', 'on');
//显示所有错误
error_reporting(-1);

//发送错误
error_log('当前系统被攻击,产生了致命错误', 1, '472323087@qq.com'); //参数 1 表示以邮件形式发送错误

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1021090.htmlTechArticlePHP配置把错误日志以邮件方式发送方法(Windows系统),php日志 当系统发生了很严重的问题,需要立刻发送给管理员。可以通过 error_log() 将...
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Tutoriels populaires
Plus>
Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!