skip to Main Content

I am uploading a file In Laravel. If I upload a file of 2 MB then it is working, but If I upload a file of 10 MB it is not working. If I check php.ini it shows max_post_size 1024 MB and max_file_upload 1024 MB.

It is working fine on local. I am using centos and nginx server.

2

Answers


  1. Probably you should change your php configuration file to allow receipt of bigger files. See the accepted answer to the question "Change the maximum upload file size"

    Update: "By default, Nginx has a limit of 1MB on file uploads. To set file upload size, you can use the client_max_body_size directive, which is part of Nginx’s ngx_http_core_module module. This directive can be set in the http, server or location context."

    For details see https://www.tecmint.com/limit-file-upload-size-in-nginx/

    Login or Signup to reply.
  2. Do you after changing max_post_size and max_file_upload restart nginx service?

    Maybe in error log you saw the answer:

    /var/log/nginx/nginx_error.log
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search