我正在尝试使用' maatwebsite / excel'在laravel 5.4中上传excel文档。我有两个运行我的网络应用程序的系统。首先是我使用流浪家园的当地窗户。第二个是尽可能靠近宅基地运行的AWS实例。两者都具有来自git存储库的相同代码库。我最近用
更新了作曲家sudo composer dump-autoload -o
sudo composer update
在作曲家在两台机器上完成它之后,aws实例将不会上传大于2 Mb的文件。
在/etc/php/7.0/fpm/php.ini
我改变了:
upload_max_filesize = 100M
post_max_size = 100M
以下是两台机器的dd($ request-> all()):
Vagrant Homestead:
array:4 [▼
"_token" => "N6cm28un74NyWko8KhzrLTmY2xPlfslWtRVVgyPl"
"project_id" => "1"
"ModType" => "Replace"
"Import" => UploadedFile {#309 ▼
-test: false
-originalName: "Test.xlsx"
-mimeType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
-size: 2252013
-error: 0
#hashName: null
path: "/tmp"
filename: "phpr0BsD9"
basename: "phpr0BsD9"
pathname: "/tmp/phpr0BsD9"
extension: ""
realPath: "/tmp/phpr0BsD9"
aTime: 2017-08-22 01:17:05
mTime: 2017-08-22 01:17:05
cTime: 2017-08-22 01:17:05
inode: 923810
size: 2252013
perms: 0100600
owner: 1000
group: 1000
type: "file"
writable: true
readable: true
executable: false
file: true
dir: false
link: false
}
]
来自AWS
array:4 [▼
"_token" => "KTvgaPsEpgiwaUkFKlgp4eboUrE7Q1mC4ZbXDKZb"
"project_id" => "1"
"ModType" => "Replace"
"Import" => UploadedFile {#309 ▼
-test: false
-originalName: "Test.xlsx"
-mimeType: "application/octet-stream"
-size: 0
-error: 1
#hashName: null
path: ""
filename: ""
basename: ""
pathname: ""
extension: ""
realPath: "/var/www/hrland-homestead-7/public"
aTime: 1970-01-01 00:00:00
mTime: 1970-01-01 00:00:00
cTime: 1970-01-01 00:00:00
inode: false
size: false
perms: 00
owner: false
group: false
type: false
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
]
如何让我的AWS实例上传大于2 MB的Excel文档?
答案 0 :(得分:0)
一旦我更改了php.ini文件,我忘了重启php服务
sudo service php7.0-fpm restart