简体   繁体   中英

laravel 5.4 file upload error

I am trying to upload an excel document in laravel 5.4 using 'maatwebsite/excel'. I have two systems that run my web app. The first is my local windows using vagrant homestead. The second is an AWS instance running as close to homestead as I can get. Both have the same code base from a git repository. I have recently updated composer with

sudo composer dump-autoload -o
sudo composer update

After composer did it's thing in both machines, the aws instance will not upload files greater than 2 Mb.

In /etc/php/7.0/fpm/php.ini I have changed:

upload_max_filesize = 100M
post_max_size = 100M

Here is the dd($request->all()) from both machines:

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
  }
]

From 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
  }
]

How do I get my AWS instance to upload excel documents larger than 2 MB?

更改php.ini文件后,我忘记重新启动php服务

sudo service php7.0-fpm restart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM