php如何抛出错误
2022-12-02 09:01:16
63
{{single.collect_count}}

php抛出错误的方法:首先调试php报错;然后通过“set_error_handler('socketErrorLog');”方式抛出php错误即可。

php入门到就业线上直播课:进入学习
Apipost = Postman + Swagger + Mock + Jmeter 超好用的API调试工具:点击使用

推荐:《PHP视频教程

php 抛出错误的 调试方法

//调试 php报错function socketErrorLog($errno, $errstr, $errfile, $errline){$log = '[' . date('m d H:i:s') . '] errno:' . $errno . " errfile:$errfile line:$errline\n";$log .= "error: " . $errstr;$log .= "\n========================================================\n";file_put_contents(dirname(__FILE__).'/chaoyu.log', $log, FILE_APPEND);}//抛出php错误set_error_handler('socketErrorLog');
登录后复制

以上就是php如何抛出错误的详细内容,更多请关注php中文网其它相关文章!

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}