When trying to upload large files to in the MAP (Magento Admin Panel) you may see the message:
A technical problem with the server created an error. Try again to continue what
you were doing. If the problem persists, try again later.
This could be for a number of reasons, though if you inspect the network request made and see the response "413 Request Entity Too Large" this is like down to Nginx and PHP-FPM configuration.
Fortunately to resolve this you only need to update a few settings within MDOQ.
Prerequisites
- A development instance
- A large enough file to replicate the issue on the instance
Steps
- Select the development instance and navigate to "Settings"
- Open "Site Nginx", deselect "Inherit from live" for Additional Custom Params and add the params:
Name: client_max_body_size
Value: XXm
(Where XX is the size in Mb you wish to limit to, this should be larger then the value of the file you are trying to upload, you can also use 'g' for Gb) - Open "PHP FPM", deselect "Inherit from live" for Additional Config (php.ini) and add the params:
Name: upload_max_filesize
Value: XXM
Name: post_max_size
Value: XXM
(Where XX is the size in Mb you wish to limit to, this should be larger then the value of the file you are trying to upload, you can also use 'G' for Gb) - Scroll to the bottom of the setting dialog, MDOQ will recognize that you have changed settings for PHP-FPM and Nginx, click "Save" leaving Recreate modified component check.
- Once the instance has finished synchronizing, confirm that you are now able to upload the file(s).
- Repeat steps 2 & 3 for your production instance. MDOQ will not offer to automatically synchronize the components for production. So just click save.
- When you are ready to apply the changes to live, simply select your production instance, navigate to "Sync", select "Show More" and then check PHP-FPM (Nginx is a dependant so it will be sync'd as well.
Then click "Proceed"
This will involve some downtime as MDOQ applies the configuration.
Not Hosted With MDOQ?
If you are not hosted with MDOQ, you can still carry out the work on a development instance to validate that these steps solve the issue for you.
Once happy, copy the settings into your Live Connector instance so future development instances use them.
Then contact your hosting company and request the following:
- Update Nginx config to include
client_max_body_size XXm;
- Update PHP-FPM config to include
post_max_size=XXM
upload_max_filesize=XXM
After changing the configuration Nginx will need reloading and PHP-FPM will need restarting.