When installing a New Drupal installation or upgrading your Drupal you may experience the following error.
“An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports.”
What causes this error?
There are several reasons this error may be thrown. There may be an issue with the php.ini settings, conflicting .htaccess or settings.php code, or you may be flagging Apache’s mod_security. Below are some fixes to this “An unrecoverable error” occurred error.
Checking the php.ini memory settings
Edit your local PHP settings to see if your file size settings are high enough for your Drupal to work. The following shows a typical file size settings
post_max_size = 128 MB upload_max_filesize = 32MB
You can increase the post_max_size and the upload_max_filesize to a higher number to see if this fixes the problem. You will need to make the php.ini recursive in the .htaccess for the change to take effect.
Check the .htaccess or settings.php for conflicting code
Edit the .htaccess file to see if there are any overrides in the code. Some server configurations allow .htaccess settings to override your file upload size. Comment any code that controls the files upload size and save the changes.
The settings.php file also can hold overrides for the file upload size. Edit the settings.php directly on the server or you can change the settings through the Drupal dashboard by going to Administer > Site configuration > File uploads and updating the settings from there.
Apache mod_security is flagging bad code
Mod Security is an Apache Module that scans incoming http requests for any malicious scripts. There may be an issue with the script causing mod_security to stop the script. In the event that mod_security is causing the error, you will need to contact tech support to have them look at the logs to see what is exactly causing mod_security to flag the uploaded file. You may need to Disable mod_security via cPanel Modsec Manager on your specific domain if there is no work around. Otherwise, tech support will need do this for you.