php readfile 错误怎么办
2022-12-02 09:01:16
106
{{single.collect_count}}

php readfile错误是因为在代码中多输出了一个换行符,其解决办法:首先打开相应的PHP文件;然后删除多输出的换行符;最后重新通过readfile读取文件即可。

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

本文操作环境:Windows7系统、PHP7.1版,DELL G3电脑

具体问题:

php 的readfile读取文件出错?

7199963eadf752841488254268dba44.png

这样打开是说图片损坏的,求解.如何解决?这样原理是为什么?

解决办法:

多输出一个换行符了

<?phpheader('Content-Type: image/jpeg');readfile('626123287.jpg');exit(0);?>
登录后复制

推荐学习:《PHP视频教程

以上就是php readfile 错误怎么办的详细内容,更多请关注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 ? '加载中...' : '查看更多评论'}}