上傳較大文件時候,會出現(xiàn)"413 Request Entity Too Large","504 gateway time out"等問題
解決該問題主要是配置文件設(shè)置,以下可以用作參參考
php.ini
# 最長執(zhí)行時間
max_execution_time = 300
# 接收數(shù)據(jù)的時間限制
max_input_time = 600
# 可以使用的內(nèi)存大小
memory_limit = 128M
# 默認(rèn)文件上傳大小為2M
upload_max_filesize = 20M
# 限制通過POST方法可以接受的信息最大量
post_max_size = 30M
# 每次最大上傳文件數(shù)量
max_file_uploads
nginx:
#客戶端上傳文件大小設(shè)為10M
client_max_body_size 30m;
# 超時設(shè)置
send_timeout 60;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;