I’d like my site visitors to be able to upload photos through a simple form. I’m using Statamic CMS (v2) that’s been deployed via Laravel Forge.
I’ve added client_max_body_size 20M; in the http section of my nginx.conf file (/etc/nginx/nginx.conf);
I’ve also modified upload_max_filesize and post_max_sizein two php.ini files (/etc/php/7.4/fpm/php.ini and /etc/php/7.4/cli/php.ini), both to allow 20mb file uploads.
After those modifications I restarted my nginx web server (systemctl restart nginx).
The good thing: when I try to upload a file larger than 2 mb and submit the form, I no longer get a ‘431 entity too large’ error, but the form just seems to doesn’t work. Like it submits the entry into the void.
Am I overlooking something?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello, kvkooten
Could you please confirm that the upload_max_filesize change has taken effect? What you can do is to create an info.php file and then check the value. You can create a file named info.php (the name doesn’t really matter) and put the following content in the file:
<?php
phpinfo();
Then all you need to do is to access the file in your browser and you’ll see all the information about the php extensions and values as well.
Additionally you can examine the Nginx and the PHP error_logs for any logged references that can help us to locate the issue. You can also try increasing the memory_limit , max_input_time and max_execution_time values.
Regards, Alex
Alex, nevermind — I guess I was a little impatient. Everything seems to be working fine. Not sure if editing the php.ini in both the ‘fpm’ and ‘cli’ folders was necessary, but apparently the server (or my browser) had to figure out that I’d made adjustments.
Large® file size uploads are now working perfectly!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.