duanbi8089 2012-04-10 06:19 采纳率: 100%
浏览 159
已采纳

PHP / JSON:收到$ _POST数组不完整

Around 100 rows of data are posted using $.post (JQuery) as JSON array. But for some reason not all rows are received.

The data looks more or less like this (contents are basically numbers and small strings):

rows = [["U", "0", "81949", 32 more...], ["U", "0", "81950", 32 more...] ..... ]

The way I'm sending the data is:

$.post(url+"callback=?", { data : rows }, function(){}, "json");

If I echo the number of rows (count($_POST)) received in my local version it shows "100", but at the production server it displays "25" (every time is the same amount).

Checking the request details in firebug, it shows correctly that all 100 has been sent.

I though it could be the PHP "post_max_size" value, but I had it set to "100M", which I think is by far enough.

I'm pretty sure it has to be with the server settings, but I'm out of ideas... Thanks in advance.

UPDATE:

  • The production server has 8GB of Memory, which is using about half of it (it is not a memory issue).
  • There is no timeout (all the process is done in about 3 seconds).
  • 写回答

3条回答 默认 最新

  • doudeng2025 2012-04-10 06:52
    关注

    Is your production server using suhosin? Suhosin is often a culprit for limiting the request sizes, both GET and POST. They have separate limits for POST and GET sizes (and in fact one affects the other from what I remember, thus both have to be increased).

    Take a look at your phpinfo() and see if there's anything about suhosin there.

    Suhosin values that may affect you:

    • suhosin.get.max_vars
    • suhosin.post.max_vars
    • suhosin.request.max_vars

    (+ their equivalents for value and var length)

    Also, if you're uploading files, then this too is limited by suhosin:

    • suhosin.upload.max_uploads (which is, consequently, 25 by default)
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 curl 命令调用正常,程序调用报 java.net.ConnectException: connection refused
  • ¥20 关于web前端如何播放二次加密m3u8视频的问题
  • ¥15 使用百度地图api 位置函数报错?
  • ¥15 metamask如何添加TRON自定义网络
  • ¥66 关于川崎机器人调速问题
  • ¥15 winFrom界面无法打开
  • ¥30 crossover21 ARM64版本安装软件问题
  • ¥15 mymetaobjecthandler没有进入
  • ¥15 mmo能不能做客户端怪物
  • ¥15 osm下载到arcgis出错