Apache上傳報錯記錄
上傳檔案失敗
可以去配置下php.ini
; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
;upload_max_filesize = 2M
upload_max_filesize = 10M
針對其他跑錯,可以如下。
上傳檔案提示Request Entity Too Large報錯
或者日誌request body exceeds maximum size (131072) for SSL buffer
Apache
- LimitRequestBody(請求實體限制)-----預設0到2G,如有需要可設定
- SSLRenegBufferSize(緩衝區大小)
1.LimitRequestBody:這項配置一般在Apache做反響代理伺服器用到,具體用法是在Apache配置檔案中加上這樣一句(後面所跟的數值的單位為K):
LimitRequestBody 102400 #允許上傳最大為100k的檔案
Description: | Restricts the total size of the HTTP request body sent from the client |
---|---|
Syntax: | LimitRequestBody bytes |
Default: | LimitRequestBody 0 |
Context: |
server config, virtual host, directory, .htaccess |
Override: | All |
Status: | Core |
Module: | core |
This directive specifies the number of bytes from 0 (meaning unlimited) to 2147483647 (2GB) that are allowed in a request body.
The LimitRequestBody
directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly depending on the nature of the resource and the methods allowed on that resource. CGI scripts typically use the message body for retrieving form information. Implementations of the PUT
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.
2.SSLRenegBufferSize:在進行SSL握手之前,Apache會將請求先存放到緩衝區中,這項配置決定了緩衝區的大小:
SSLRenegBufferSize 262144 #緩衝區大小為262144Bytes
Description: | Set the size for the SSL renegotiation buffer |
---|---|
Syntax: | SSLRenegBufferSize bytes |
Default: | SSLRenegBufferSize 131072 |
Context: | directory, .htaccess |
Override: | AuthConfig |
Status: | Extension |
Module: | mod_ssl |
If an SSL renegotiation is required in per-location context, for example, any use of SSLVerifyClient
in a Directory or Location block, then mod_ssl
must buffer any HTTP request body into memory until the new SSL handshake can be performed. This directive can be used to set the amount of memory that will be used for this buffer.