【问题标题】:Codeigniter AJAX POST 66 records maximumCodeigniter AJAX POST 最多 66 条记录
【发布时间】:2013-06-02 05:39:30
【问题描述】:
  1. 我们有无限行的表单
  2. 每行有 10 个数据属性
  3. 所有行都通过 AJAX POST 发送到 CodeIgniter 脚本,其中 AR 作为关联数组的数组
  4. 在脚本中每一行生成查询
  5. 在所有脚本运行 insert_on_duplicate_update_batch 3 次和 insert_batch 1 次之后

ajax post 请求的内容长度为 99299

任何更新和插入查询只产生 66 行!

Nginx + php-fpm

nginx.conf

proxy_buffer_size   128k;
proxy_buffers   4 256k;
proxy_busy_buffers_size   256k;

php.ini

post_max_size = 8G
memory_limit = 512M
upload_max_filesize = 2G (dunno need that info but ok)

【问题讨论】:

    标签: php ajax codeigniter codeigniter-2


    【解决方案1】:
    var aja = $.ajax({
        async: true,
        url: host,
        type: 'POST',
        data: {elems: arrayOfAssociativeArrays},
        dataType: 'html'
    });
    

    所以如果像关联数组一样发送数据需要增加php的值。ma​​x_input_vars 所以,在 php.ini

    max_input_vars = 1000
    

    max_input_vars = 5000000
    ;Dunno if 0 is unlimited
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-03
      • 2015-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多