Apache Trouble Reading Address Line Too Long
When building and maintaining a website, you're bound to encounter some unexpected HTTP errors here and in that location. Problems like these are tough to avoid, and some are trickier to resolve than others. If you lot're experiencing a "413 Request Entity Too Large" mistake, the good news is that this result is quick and simple to accost — you merely need to do a scrap of server reconfiguration. And no, you don't need to be a technical expert. Allow's learn how. A 413 HTTP error lawmaking occurs when the size of a client's asking exceeds the server's file size limit. This typically happens when a client attempts to upload a big file to a spider web server, and the server responds with a 413 error to alert the client. Web servers place size limits on uploads to preclude users from overwhelming the server and exceeding storage permissions. This limit unremarkably isn't an result, and common website files should stay well under it. However, specially large file uploads may occasionally exceed the limit, resulting in a message similar this: While you can reduce the size of your upload to get around the error, it'due south also possible to modify your file size limit with some server-side modification. Your default upload size limit will depend on how your server is set up. In this guide, nosotros'll evidence y'all how to fix a 413 error by increasing your size limit with a WordPress setup, as well as with an Apache or Nginx server configuration. All methods require some edits to your server files, so we recommend creating a backup before attempting the steps below. Themes and plugins are common causes of the 413 error with the WordPress content management system. Fortunately, there are several ways to increase your WordPress upload size limit enough to let these larger files through. Equally long as yous do not exceed the limits of your hosting plan, yous can try whatever of the post-obit: The easiest method to increase your upload limit is by modifying your server'southward PHP.ini file. Here, you lot can alter your limit through the cPanel interface without any coding. To practice this: 1. In your cPanel menu, select MultiPHP INI Editor under Software. ii. In the window that appears, choose your domain from the dropdown menu. three. Modify the values of the following parameters to your preference: 4. When finished, click Utilise. If your WordPress site is hosted on an Apache server, information technology's also possible to increase your server's limit via .htaccess, a file that contains many directives for the server. See the solution beneath. You tin can also effort increasing your size limit via the functions.php file of your current WordPress theme. If you lot want to make this change permanent, we recommend trying the in a higher place approaches first. With this arroyo, you'll need to update functions.php whenever y'all update or change your current theme. 1. In your cPanel carte du jour, select File Manager under Files. 2. Navigate to the folder of your electric current theme inside your root WordPress directory (public_html by default). Open up this theme file. iii. Select functions.php and click the Edit icon. iv. Re-create the code below and paste it at the end of the file 5. Click Relieve. This code sets the maximum allowed size of your WordPress uploads and posts to 64 megabytes. Yous tin can alter this number to something larger or smaller if y'all need, every bit long every bit you practice non exceed your hosting plan's storage limit. Information technology besides sets the maximum period your uploads can have to 300 seconds. Feel free to change this also. Nginx server settings can be modified inside the file nginx.conf. Open this file and bank check for the directive client_max_body_size. Then, change the value (in megabytes) to your maximum file size preference. If you do not see this directive in nginx.conf, y'all can add it to the finish of a server, location, or http block similar so: This allows for a 64-megabyte upload. Set this number to your preference, save the file, then reload Nginx for the change to accept upshot. Change the size limit on an Apache server by updating your .htaccess file like so: 1. In your cPanel card, select File Manager under Files. 2. In your root WordPress directory (public_html by default), locate .htaccess. Depending on your settings, the .htaccess file may exist hidden. 3. Select .htaccess and click the Edit icon. four. Copy and paste the code below at the bottom of your .htaccess file: 5. Click Relieve and reload Apache. Doing this sets the maximum allowed size of your WordPress uploads and posts to 64 megabytes and sets the maximum file upload fourth dimension to 300 seconds. Y'all tin can change both of these values to your preference. Afterward trying one or more of the solutions above, you still may encounter a 413 error when uploading large files, even if these files are below your new size limit. In this example, the issue may stem from your CDN's servers or some other restriction set past your hosting provider. First, reach out to your hosting support, detailing the problem and the steps you've taken then far to resolve it. It may exist that you've exceeded your program's file size limit without realizing. Or, your configurations may accept inadvertently caused some other error. If you apply a CDN to improve your site'due south performance, this may likewise be the crusade of your issue — the CDN servers you lot're using may impose file size limits that are too small. Since you probably can't modify these servers' files directly, you consult the documentation for your CDN provider or contact production support to resolve the mistake. If all else fails, consider uploading alternative files, reducing the size of your current file, or upgrading your storage plan. If you detect yourself needing to upload a massive amount of data, more probable than non there's a workaround. While HTTP errors can be frustrating, many are quickly solvable including a 413. By finding and tackling this outcome now, y'all'll have ane less matter to worry almost while building out your website. If your site allows users to upload their ain content, irresolute your upload size limit solves this problem also — just brand sure you're not exceeding the limits set by your hosting programme. As for the best option, nosotros recommend WordPress users modify their server'due south PHP.ini file beginning if possible, since this can easily exist done through your hosting panel. Otherwise, choose the choice that matches your server software. This post was originally published in January 2021 and has been updated for comprehensiveness.
What does "413 Asking Entity Too Big" mean?
How to Gear up a "413 Request Entity Too Large" Error
WordPress
Modify PHP.ini
Alter .htaccess
Modify functions.php
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );
Nginx Server
server {
...
client_max_body_size 64M;
}
Apache Server
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
Still getting a 413?
Fixing a 413 Fault
Originally published Oct v, 2021 7:00:00 AM, updated October 05 2021
Source: https://blog.hubspot.com/website/413-request-entity-too-large
0 Response to "Apache Trouble Reading Address Line Too Long"
Post a Comment