PHP 如何捕获所有错误
我有一个 PayPal IPN 文件,但似乎不起作用。由于时间很长,所以在我尝试逐行调试之前,我想知道 PHP 中是否有一种方法可以捕获阻止页面正常执行的任何错误。然后我可以抓住它并通过电子邮件发送给自己。这会节省我很多时间。
我已经尝试了一些方法,并且知道 PayPal 正确处理了交易,并且 IPN 已发送到我的 IPN 页面。所以,我确信我的代码中有些东西搞砸了,但几乎不可能在本地调试它。
所以我的问题是:有没有办法捕获阻止文件执行的错误?
谢谢你!
I have a PayPal IPN file that doesn't seem to work. It is very long so before I try to debug line by line, I'd like to know if there is a way in PHP to capture whatever error prevents the page from executing properly. I could then grab that and email it to myself. This would save me a lot of time.
I already tried a few things and know that the transaction is handled by PayPal properly and the IPN is sent to my IPN page. So, I'm sure that something got messed up in my code but it is almost impossible to debug it locally.
So my question is: Is there a way to capture the error that prevents the file from executing?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RTFPHPM?
(当然,F 代表“友好”;-)
RTFPHPM?
(F for "friendly", of course ;-)
在 php.ini 中打开错误日志记录 - 您可以将其记录到文件、系统日志、输出到屏幕等。
Turn on error logging in php.ini - you can have it log to a file, to the syslog, output to the screen etc.