HTTP Error on large file upload in Wordpress - php

I have looked for this problem's solution everywhere but nothing seems to be working.
I get HTTP Error while uploading a file (PDF) with size around 10 MB. I also tried uploading another PDF with size 4 MB and it got uploaded at once. No issues.
Note: I have increased the default upload file size limit to 32 MB by using the custom plugin here
Please suggest me what to do. I do not have any php.ini and .htaccess. And I have no support from my hosting provider. Please help.

once check your php configuration
post_max_size & upload_max_filesize
Check upload settings
/wp-admin/settings.php

In my case the cause was plugin All In One WP Security an its "Basic Firewall Settings". The above firewall features are applied via your .htaccess file and one if these features is "Limit file upload size (10MB)."
So to make upload of files larger then 10 MB working again you can do following:
1) Go to WP Security / Firewall / Basic firewall rules tab and uncheck "Enable Basic Firewall Protection". Then Save settings. This will disable all Basic firewall settings and this 10 MB upload limitation as well.
or
2) If you want to keep the basic firewall rules but remove only that limitation, you need to use “Custom Rules”. Go to WP Security / Firewall / Custom rules tab and check "Enable Custom .htaccess Rules:". Then put in the custom rules text area:
LimitRequestBody 64000000
That will allow approx. 64 MB uploads. Also make sure that “Place custom rules at the top” checkbox is NOT checked, so it overwrites the 10M limit from above.

Related

WP Multisite Dashboard how can I change Media Space allowed?

In a WP Multisite installation the first site shows, Media Space allowed of 35MB.
Storage Space
35 MB Space Allowed (Manage Uploads)
12.39 MB (35%) Space Used
Where is the setting to change this?
I have already tried already changing setting Max upload file size from 35000KB to 100000KB but obsviously is a different setting.
I do not have settings for file size in .user.ini o .htaccess or wp-config.php
I already have checked in CPanel taht php upload_max_filesize (MB) is set to 35MB and post_max_size (MB) also to 35MB
Can anybody help?
I find out myself. Sorry I did not see the setting
'Site upload space'. (I suppose is for each site of the WP Multisite)

Wordpress: 413 Request Entity Too Large

I have a WP site managed on an Ubuntu server with Plesk.
For a few hours I can not upload files above 2MB.
I have made several attempts like:
Change the settings from php.ini (verifying via phpinfo () that they were set correctly).
Both through Plesk and manually;
Change different PHP versions (from 5.6, 7.0.x, 7.1.x, to 7.2.x);
Disabled firewall;
Tested with different types and name files;
Set the upload limit with nginx (either manually or via plesk);
Tried to set the limit via .htaccess and / or wp-config;
Updated WP, ​​plugins and themes;
Disabled all plugins;
Try to decrease the upload limit to 1 MB (in this case it displayed the limit and did not allow me to proceed with the upload);
Tested by other PC / browsers.
On other sites uploaded to the same server, with the same settings (one is the backup of the site in question) instead I can correctly upload the files.
On the file upload screen I see the upload limit correctly (for example 64M) but if I upload a file greater than 2MB I see the error:
413 Request Entity Too Large
What could it be? Do you have any ideas / suggestions on this?
Thanks a lot!
Most probably that the reason of this issue is ModSecurity settings. Check solution from https://support.plesk.com/hc/en-us/articles/115001764933-Unable-to-edit-document-on-the-website-ModSecurity-Request-body-no-files-data-length-is-larger-than-the-configured-limit-
To fix, you need to set server block like this
server {
client_max_body_size 0;
...

Wordpress upload size reduced to under 20MB even though it says the limit is 505MB - happened within last 24hrs

We have a file sharing form on our website, which allows file uploads of up to 505MB. To enable this, I did the following:
In Plesk, changed the PHP settings for the site subscription to the following:
memory_limit = 530M
max_execution_time = 300
max_input_time = 250
post_max_size = 525M
upload_max_filesize = 505M
In the Apache / NGINX settings, in the additional directives for BOTH http and https:
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 1073741824
FcgidMaxRequestsPerProcess 100
FcgidProcessLifeTime 7200
</IfModule>
In a .conf file in /etc/nginx/conf.d (which gets loaded into the http block in nginx.conf):
client_max_body_size 512M;
Previously these settings worked fine for our customers, but today suddenly they don't. On the front end of the site, when the customer submits the file upload they get an error message "Request Entity Too Large" which usually means the nginx client body max size is not big enough.
I thought it was the form, but when I checked the Wordpress media library from the admin and it also cannot upload a bigger file - even though it shows 505M on the wordpress upload window "Maximum upload file size: 505 MB." It just says "http error"
What I've Tried:
Double checking all of the above to make sure it hadn't changed.
loaded a phpinfo file and confirmed the correct config and directives are used
Restarting the server
Searching the forums, but no solutions have worked, such as:
adding rules to .htaccess
adding rules to php.ini in /wp-admin folder
adding rules to wp-config.php
deactivating all plugins
reverting to a default theme
Has this happened to anyone else? I'm wondering if it was a plesk update or php update that caused it, or if it's related to just my server. It is happening to other sites on our shared server too, not just one. I hope I've explained it enough - appreciate the help.
Solution found!
In the end, I went to plesk.com and paid for a support service (only $10/mo) and their developers figured it out in about 6 hours and 8 emails. Turns out, it was an issue with a plesk microupdate that enabled ModSecurity, which applies its own limits on upload size in a config file that loads a module.
****In their words:
One of Modsecurity packages contains the configuration file /etc/httpd/conf.modules.d/10-mod_security.conf which loads security2_module by default
However, Plesk treats modsecurity as disabled by default. Therefore we have such discrepancy: Plesk shows modsecurity as disabled but it is actually enabled on the server. Also, it is not possible to disable modsecurity with the command:
# plesk sbin modsecurity_ctl -d
This behavior has been submitted as a bug PPPM-8557 which is planned to be fixed in one of the future Plesk updates.
So, in order to stop ModSecurity from messing with things, it was temporarily disabled by enabling and disabling it in Plesk UI.
I can confirm that the upload form is now working as it should. Plesk.com paid support WELL worth the money.
Plesk Control Panel:
Firstly, log into your Plesk Control Panel.
Select 'Domains' from the left hand Navigation Panel.
Select desired domain's 'Manage In Customer Panel' link.
You should see a Panel like the following:
Simply select the 'PHP Settings' link.
Scroll down to the 'Performance Settings' area and modify the 'upload_max_filesize' and 'post_max_size'.
There may be a maximum limit, from your drop down menu. Simply ignore the drop down options and manually enter the correct numbers. For example: 505M.
What you are doing here, is setting a maximum allowed file size within the Plesk Control Panel. If your php.ini exceeds this amount, it will 'default' back to the maximum allowed set within the Plesk Control Panel.
php.ini File:
Next, you will need to head to:
/var/www/vhosts/system/example.com/etc/php.ini
Then made the relevant modifications within the php.ini file. Needless to say, example.com being the affected domain.
Setting the post_max_size and upload_max_filesize accordingly, ensuring they are within the limits set within your Plesk Control Panel.
Hope this helps!

Wordpress theme and plugin upload disabled, theme editor disabled as well

I'm developing an old wordpress website. There I can not upload any theme/plugin. I mean there's no add new option for plugins and themes. I updated it to the latest 4.7.1 version but still no luck. In config.php file there's no DISALLOW_FILE_MODS or DISALLOW_FILE_EDIT such option defined. I can't figure out where this disable option came from?
Also it's uploaded on a sftp server. I can manually upload any plugin to wp-content/plugins folder through sftp but after activating the plugin it makes the website frontend white screen death.
Overall, how could I allow theme,plugin uploading or how could I allow add new options to them?
Reading around the web about this, it seems like this might be caused by not having enough resources to operate, so I assume WordPress checks for this and disables in advance the ability to add new content.
I suggest checking the following values in the php.ini config file (you can run a script containing <?php phpinfo() ?> from the server to see the values faster; just don't make it publicly accessible):
display_memory - should be at least 128M
max_post_size - by default is 8M, try setting it to 128
upload_max_filesize - by default is 2M, try setting it to 128

Upload File Size Limit: Symfony Admin Generator Module

I have form created by the admin generator in the backend of a website. It allows the upload of a video to the site.
It works fine but strangely, the upload fails for files of 10mb or over. However, I have not set any file limits in my form.
Are there Symfony/PHP/Apache/web browser settings regarding this type of behaviour that I can look into?
Or is there a way I can inform Symfony that I'd like to permit larger files?
Even I haven't ever worked with Symfony I expect the problem due to limitations on your Web-Server.
If you have the possibility to edit or add your .htaccess file then the following line of code will probably help you:
php_value upload_max_filesize 100M
the 100M in example is for 100 Megabyte.
Also make sure that (at a minimum) you update post_max_size to match. See the PHP documentation, especially the sections on "Common Pitfalls" and "Error Messages Explained".

Categories