,前端post提交 一大坨数据。
,前端post提交 一大坨数据。后端使用php7.0接收但是 $_POST 里面接收的数据不完整经过一番查找最后发现是php环境的配置问题
例如:在盘点表的数据提交中出现了POST大量数据超多字段的将近2000个字段,部分字段没有接收或者被截取;修改方法为修改php.ini
将max_input_var调大,该值默认为1000
max_input_vars = 5000

注意把前面的分号去掉
相近的配置还有:
max_execution_time = 600 max_input_time = 600 memory_limit = 32m file_uploads = on upload_tmp_dir = /tmp upload_max_filesize = 32m post_max_size = 32m在nginx中相近的配置有:
keepalive_timeout 60; send_timeout 3m; client_max_body_size 500m;
例如:修改上传图片的最大限制,避免entity too large的错误
首先,将php的upload_max_filesize 和 post_max_size 调大
再将nginx的 client_max_body_size 调大
或将apache的LimitRequestBody调大
//php配置 max_execution_time = 600 //设置页面访问超时时间为600s max_input_time = 600 //设置GET和POST等接收数据的最大超时时间为600s file_uploads = on upload_tmp_dir = /tmp upload_max_filesize = 50m //设置为50M post_max_size = 50m //设置为50M //nginx配置 client_max_body_size 50M //设置为50M //apache配置 LimitRequestBody 50 * 1024 * 1000 //设置为50M
例如:Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes)
注意这个不是因为memory_limit参数的问题,即使memory_limit配置的最大也有可能出问题;关键在于代码循环中unset变量;
(adsbygoogle = window.adsbygoogle || []).push({});
赞
(1)
打赏
微信扫一扫
支付宝扫一扫


td 内容自动换行 table表格td设置宽度后文字太多自动换行
上一篇
2020年03月04日 08:26
mysql对指定字段的字符串内容进行截取的方法
下一篇
2020年03月13日 08:39
这里是广告位
相关推荐
-
readfile(): Unable to find the wrapper ".http" - did you forget to enable it when you configured PHP?
readfile(): Unable to find the wrapper ".http" - did you forget to enable it when you configured PHP?
-
PHP使用strtotime("-1 month", time())得到上个月是错的
今天是3月30号,使用strtotime得到的不是2月份,而是3月份。解决方法是可以把时间戳先转换成年月,$t = date(Y-m);然后再使用strtoti