Discuz教程网

让discuz支持大附件上传

[复制链接]
authicon dly 发表于 2013-10-31 12:17:21 | 显示全部楼层 |阅读模式
今天产品那边有个需求:需要在discuz上传视频文件,文件大小超过100M,在discuz后台设置了上传附件大小后,出现server io error的错误。
20130926125723_59615.jpg

第一感觉就是php那边的文件上传做了限制,对php.ini 配置文件做了相应修改:
  1. max_execution_time = 600     ; Maximum execution time of each script, in seconds
  2. max_input_time = 600        ; Maximum amount of time each script may spend parsing request data
  3. memory_limit = 512M      ; Maximum amount of memory a script may consume (8MB)
  4. post_max_size = 500M
  5. upload_max_filesize = 500M
复制代码
重启php-fpm,可以上传大于50M的文件,但是发现当上传文件大于100M时就又出现server io error。觉得会不会是nginx做了限制,果不其然,nginx做了上传附件大小为100M,修改相应配置后,重启nginx,上传大于100M的文件正常了。
  1. client_max_body_size 500m;
复制代码
就是这个client_max_body_size捣蛋鬼,nginx默认设置为1M。
当上传文件大小被限制时,修改php.ini配置无效后,可以尝试修改nginx client_max_body_size 配置项。




上一篇:一个模拟discuz发帖的php类
下一篇:discuz uchome头像上传功能
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 14:34

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表