Joseph Morgan
Published in : 2022-02-01
Hello there,
I am facing this error when I try to upload image more than 1MB to my server which is running with Laravel & Nginx
What Should i do, I tried to update the php.ini & increased the values of
post_max_size
upload_max_filesize
max_execution_time
and nothing is changing the same error, please help!
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now
Mohamed Atef Date : 2022-02-01
Best answers
51
Best answers
51
It seems that the error is not from PHP this is Nginx error I suggest that you can update the client_max_body_size from the configuration file by the next steps
cd /etc/nginx/sites-available
sudo nano default (sudo nano domain_name)
Like
that's all, good luck
Joseph Morgan Date : 2022-02-01
Best solution, you are amazing :) Thanks
Mayur Tandan Date : 2022-07-21
Hi Joseph,
I am using laravel 5.4 with PHP 7.4. Trying to upload 6 mb file after converting into base64 from from frontend angular using laravel API getting 413 error. Changed nginx conf settings set 120M also changed php.ini settings.
```
upload_max_filesize 100M;
post_max_size 100M;
memory_limit 120M;
```
still getting the same error. what could be the reason.
Mohamed Atef Date : 2022-07-21
Have you changed the client_max_body_size? in the nginx.conf?
Mayur Tandan Date : 2022-07-22
Yes, I already changed it.
Mohamed Atef Date : 2022-07-22
Have you restarted the Nginx server? or Apache2?
Mayur Tandan Date : 2022-07-22
Yes, after changing the Nginx setting restarted the Nginx server and after changing the PHP settings restarted the apache server.