nginx 设置上传大小 client_max_body_size

  1. 以下代码加入 /etc/nginx/nginx.conf 文件中的 http{ ... } 块中
# set client body size to 8M #
client_max_body_size 8M;
  1. php 设置上传大小

打开 /etc/php5/fpm/php.ini 文件中 修改以下几个参数

;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 32M
 
;The maximum size of an uploaded file.
upload_max_filesize = 8M
 
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 16M
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 更改ip和dnsVi /etc/sysconfig/network-scripts/ifcfg-eth0vi /...
    Xwei_阅读 5,931评论 0 3
  • 一、配置防火墙,开启80端口、3306端口 CentOS 7.0默认使用的是firewall作为防火墙,这里改为i...
    ArleyDu阅读 6,362评论 0 0
  • 系统环境 所需软件官方下载地址: 一、 安装开发包环境: 二、 关闭iptables和Selinux(生产...
    莫名其妙的一生阅读 5,142评论 0 4
  • 1.LAMP介绍  LAM(M)P:L: linuxA: apache (httpd)M: mysql, mar...
    尛尛大尹阅读 4,799评论 0 1
  • 阿怡最近被父母逼婚逼得都免疫了,看着手机里老爸发的短信:“你不结婚我就没你这个女儿!”阿怡没良心地回了句:“哦,知...
    旭辉阅读 3,214评论 0 0

友情链接更多精彩内容