php max_input_vars 導致提交資料丟失

來源:互聯網
上載者:User
一同事,讓幫忙解決問題:post了1020條資料,結果只顯示250條。

判斷可能是php的post設定問題,結果發現php.ini裡關於post的設定沒有問題。

通過 php://input 得到請求參數是完整的,就是在裝入$_POST全域變數時有問題。

本以為很簡單解決的問題,找了一個小時的原因。後來查看php這一部分源碼看到這句代碼:

if (++count > PG(max_input_vars)) {

php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));

return;

}

猛然間想起來,php5.3.10在解決hash衝突受攻擊時,增加了一個配置指令max_input_vars。php.ini中增加這個指令的值即可。

其實,調試時開啟php錯誤報表層級也可以看到有錯誤提示的。

繞了一大圈。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.