【问题标题】:Apache webserver drops large text POST variableApache 网络服务器丢弃大文本 POST 变量
【发布时间】:2016-09-21 18:00:21
【问题描述】:

我正在尝试发布大型输入类型文本,但在目标脚本上显示 POST 变量不存在。我已将我的 php.ini 设置更改为以下,但仍然无济于事。

;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 99999

; Maximum amount of time each script may spend parsing request data. Its a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.
; Note: This directive is hardcoded to -1 for the CLI SAPI
; Default Value: -1 (Unlimited)
; Development Value: 60 (60 seconds)
; Production Value: 60 (60 seconds)
; http://php.net/max-input-time
max_input_time = 4800

; Maximum input variable nesting level
; http://php.net/max-input-nesting-level
;max_input_nesting_level = 256

; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 10000

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 2048M

Apache 警告日志中出现以下错误: ALERT - 超出配置的请求变量值长度限制 - 丢弃变量

如果我 var_dump: var_dump($file = file_get_contents('php://input'));

我可以看到所需的 post 变量。

任何帮助将不胜感激。

【问题讨论】:

    标签: php apache http-post webmin


    【解决方案1】:

    你可以在你的 .htaccess 中试试这个

    php_value post_max_size 128M
    

    这会将最大帖子大小增加到 128MB。

    另外,在您的 php.ini 中,“max_input_vars”被注释掉了。启用它并尝试增加值。

    【讨论】:

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