如何在PHP中错误处理FTP函数 [英] How do I error handle the FTP functions in PHP
本文介绍了如何在PHP中错误处理FTP函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当连接到mysql时,我具有获取相关错误消息和错误代码的函数,在PHP的ftp函数列表中我什么都没看到.
是否有最佳实践来处理FTP中的错误?
When connecting to mysql, I have functions to get the relevant error message and error code, I see nothing of the sort in the list of ftp functions of PHP.
Is there a best practice to handle errors in FTP?
编辑+澄清:我认为最好的错误消息是系统错误消息+我自己的消息,有没有办法捕获系统错误消息?
EDIT+CLARIFICATION: I think the best error messages are the system error messages + my own, is there a way to catch the system error messages?
推荐答案
尝试 error_get_last()
for PHP> = 5.2或 $ php_errmsg
用于较旧的版本,如链接页面中所述
Try error_get_last()
for PHP >= 5.2 or $php_errmsg
for older versions as detailed at the linked pages
这篇关于如何在PHP中错误处理FTP函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文