Heim >Backend-Entwicklung >PHP-Tutorial >php发送错误日志邮件 php error reporting php 错误处理 php 错误日

php发送错误日志邮件 php error reporting php 错误处理 php 错误日

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-07-29 08:49:17945Durchsuche

①去网上可以发送邮件的应用程序,我是在windows系统下,找到了一个叫“sendmail.exe”的文件,下载时去官网下 ,里面不仅有exe执行程序,还有种种配置。

②配置:在 sendmail.ini文件中,我们以QQ邮箱为例。

smtp_server=smtp.qq.com

smtp_port=465

smtp_ssl=auto

error_logfile=error.log

auth_username=291522145(邮箱账号)

auth_password=saturday123456(邮箱 密码)

force_sender=291522145@qq.com

③配置php.ini:

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.qq.com

sendmail_from = 291522145@qq.com

sendmail_path ="i:\abc\sendmail\sendmail.exe -t"

mail.add_x_header = On

④php程序:

<span><?php </span><span><em>ini_set</em></span>(<span>'display_errors'</span>,<span>0</span>);
<span><em>error_reporting</em></span>(<span>-</span><span>1</span>);
<span><em>ini_set</em></span>(<span>'log_errors'</span>,<span>1</span>);
<span><em>error_log</em></span>(<span>'today ids rain'</span>,<span>1</span>,<span>'291522145@qq.com'</span>);</span>

所有配置好后,重启服务,然后运行php程序,就能 发现你的 qq邮箱里多了一封邮件。

以上就介绍了php发送错误日志邮件,包括了php,错误方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn