全部
常见问题
产品动态
精选推荐
功能建议

分析中 已回复 待规划 {{opt.name}}
分析中 已回复 待规划
PHP版V6七牛云上传问题

管理 管理 编辑 删除

发现一个奇怪的问题,在添加了七牛云后,上传图片时,始终会卡60秒,才会出现图片上传成功的提示。

而七牛云后台那边,图片是很快就已经上传上去了的。

分析代码,发现在/crmeb/services/upload/BaseUpload.php文件中,getFileHeaders方法使用了get_headers函数,具体表现为:

get_headers()访问七牛 HTTPS 地址,在 IPv6 DNS 优先但无 IPv6 出口的服务器环境下,导致 PHP 阻塞 60 秒,前端表现为“上传成功但一直转圈”。

我是这样解决的,注释这整方法,重新返回数组。

       // 七牛等云存储 文件信息已在上传阶段获得

       return [

           'size' => $this->fileInfo->size ?? 0,

           'type' => $this->fileInfo->type ?? 'image/jpeg'

       ];

这样修改后,上传就秒返回数据了。

期待官方修复这个问题。

try {    $headerArray = get_headers(str_replace('\\', '/', $url), true);    if (!isset($headerArray['Content-Length'])) {        $header['size'] = 0;    }    if (!isset($headerArray['Content-Type'])) {        $header['type'] = 'image/jpeg';    }    if (is_array($headerArray['Content-Length']) && count($headerArray['Content-Length']) == 2) {        $header['size'] = $headerArray['Content-Length'][1];    }    if (is_array($headerArray['Content-Type']) && count($headerArray['Content-Type']) == 2) {        $header['type'] = $headerArray['Content-Type'][1];    }} catch (\Exception $e) {}return $header


{{voteData.voteSum}} 人已参与
支持
反对
请登录后查看

超哥cium 最后编辑于2026-05-06 09:30:11

快捷回复
回复
回复
回复({{post_count}}) {{!is_user ? '我的回复' :'全部回复'}}
排序 默认正序 回复倒序 点赞倒序

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level || item.bbs_level }}

作者 管理员 企业

{{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推荐': '推荐'}}
{{item.is_suggest == 1? '取消推荐': '推荐'}} 【已收集】
{{item.floor}}# 沙发 板凳 地板 {{item.floor}}# 【已收集】
{{item.user_info.title || '暂无简介'}}
附件

{{itemf.name}}

{{item.created_at}}  {{item.ip_address}}
打赏
已打赏¥{{item.reward_price}}
{{item.like_count}}
分享
{{item.showReply ? '取消回复' : '回复'}}
删除
回复
回复

{{itemc.user_info.nickname}}

{{itemc.user_name}}

回复 {{itemc.comment_user_info.nickname}}

附件

{{itemf.name}}

{{itemc.created_at}}
打赏
已打赏¥{{itemc.reward_price}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回复' : '回复'}}
删除
回复
回复
收起 展开更多
查看更多
打赏
已打赏¥{{reward_price}}
26
{{like_count}}
{{collect_count}}
添加回复 ({{post_count}})

相关推荐

快速安全登录

使用微信扫码登录
回复
回复
问题:
问题自动获取的帖子内容,不准确时需要手动修改. [获取答案]
答案:
提交
bug 需求 取 消 确 定
打赏金额
当前余额:¥{{rewardUserInfo.reward_price}}
{{item.price}}元
请输入 0.1-{{reward_max_price}} 范围内的数值
打赏成功
¥{{price}}
完成 确认打赏

微信登录/注册

切换手机号登录

{{ bind_phone ? '绑定手机' : '手机登录'}}

{{codeText}}
切换微信登录/注册
暂不绑定
CRMEB客服
CRMEB咨询热线 400-8888-794

扫码领取产品资料

功能清单
思维导图
安装教程
CRMEB开源商城下载 源码下载 CRMEB帮助文档 帮助文档
返回顶部 返回顶部
CRMEB客服