The Uploaded File Exceeds the Upload_max_filesize Directive in Php.ini. Wordpress Thee

Introduction

The Uploaded file exceeds the upload_max_filesize directive in php.ini mistake in WordPress, occurs when uploading big files, themes, or images. The issue is the upshot of a server-side setting that limits file sizes.

This guide provides half dozen (6) solutions on how to accommodate the appropriate parameters and resolve the file size mistake.

Introductoru image with WordPress logo and file icon.

Prerequisites

  • A working WordPress installation
  • Access to the server that hosts the WordPress installation (local or SSH)
  • If you are working from a client organization, a file manager (or cPanel)
  • A user account with sudo privileges
  • Admission to a control-line/terminal window (optional)

6 Ways to Fix Uploaded File Exceeds upload_max_filesize error in WordPress

Use the WordPress dashboard to check your current maximum upload file size. Select the Media > Add New option, as shown in the paradigm beneath.

Image is an example of where to find the maximum file limit within your WordPress dashboard.

In this instance, the maximum file size is limited to 232 MB. It is non possible to change this setting using WordPress. We provided six unproblematic solutions on how to configure maximum file size on your server.

Choice 1: Edit the .htaccess File (cPanel)

1. Open up cPanel and launch the file manager.

ii. Correct-click the .htaccess file, then click edit.

Note: If yous are not able to locate the .htaccess file, you may need to click Settings in the upper-right corner and check the box to prove hidden files.

three. Explore the file and detect the line php_value upload_max_filesize. Edit the line to look as follows:

          php_value_upload_max_filesize 256M        

This instruction changes the server-side limit on the size of the file you're allowed to upload to 256 MB.

4. Save the changes and get out the file.

Pick 2: Edit the .htaccess File using Command Line Interface

1. Access the server that hosts your WordPress site.

2. Enter the post-obit control in your Command Line Interface to access the WordPress directory:

          cd /path/to/wordpress        

Notation: The /path/to/wordpress is an example. You need to enter the correct path to your WordPress directory.

3. Open the .htaccess file with a text editor of your selection. In this case, we used the nano text editor:

          sudo nano .htaccess        

4. Explore the file and find the line php_value upload_max_filesize. Edit the line and ascertain the size you need:

          php_value_upload_max_filesize 256M        

This didactics changes the server-side limit on the size of the file you lot are allowed to upload to 256 MB.

v. Save the changes and get out the file.

Option 3: Editing wp-config.php File

This method changes the limits on the PHP file size by editing the wp-config.php file directly:

one. Access the public_html folder using cPanel.

2. Observe the wp-config.php file. Right-click the file and select the edit choice.

edit wp-config file window

Scroll nearly to the terminate of the file and find for the following annotate line:

/* That's all, end editing! Happy blogging. */

3. Add the following code merely to a higher place that line:

          @ini_set('upload_max_size' , '256M' );        

4. Save the file and exit. Try to upload your file over again.

Choice iv: Edit the wp-config.php File from Command Line Interface

one. Access the server that hosts your WordPress site.

2. Enter the following command and access the WordPress directory:

          cd /path/to/wordpress        

iii. Open the wp-config.php file with a text editor of your choice.

          sudo nano wp-config.php        

4. Discover for the following comment line:

/* That'south all, finish editing! Happy blogging. */

Displays the location of the line that needs to be added to the wp-config file to increase max upload size.

5. Add the following line just above:

          @ini_set('upload_max_size' , '256M' );        

6. Salve the file and go out.

Option 5: Edit php.ini File

The php.ini file is a configuration file for PHP variables. The following steps show you how to edit the php.ini file:

1. Log into your server hosting the WordPress site.

two. Access the Command Line Interface, and enter the following:

          cd /etc/php/7.0/cli        

Note: If yous're running a different version of PHP, brand sure to replace 7.0 with the version yous are currently using.

3. Utilize a text editor to open the php.ini file:

          sudo nano php.ini        

four. Locate the post-obit line:

          upload_max_filesize = 100M        

5. Replace 100M with a college value in megabytes. (256 MB for example)

Image shows the location of the line that needs to be edited to increase limit.

This file allows you lot to configure other settings too:

  • memory_limit 256M – Sets the max amount of retentivity a script tin can utilise.
  • post_max_size 32M – Sets the max size for the total of the Post body data.
  • max_execution_time 600 – Max fourth dimension, in seconds, that a script is allowed to run.
  • max_input_time 900 – Max time, in seconds, that a script is allowed to parse input data.

6. Save the file and get out.

Test your file upload in WordPress – the issue with file size is now resolved.

Selection 6: Contact Host'due south Support

It is not uncommon for hosting companies to set up limitations on the settings clients can edit themselves. Depending on your particular hosting company, yous might not be able to perform some of the actions described in the previous steps.

In those cases, it might exist necessary to contact your host's support services. Most hosts perform this type of configuration every bit part of their standard service.

Conclusion

At present you know how to ready the error "The uploaded file exceeds the upload_max_filesize directive in php.ini." in WordPress. This tutorial covered 6 dissimilar methods to increase the maximum file upload size.

Regardless of the called method, by following these simple instructions, y'all are now able to define the maximum file size when uploading files to your website.

Was this article helpful?

Yes No

williamsuted1941.blogspot.com

Source: https://phoenixnap.com/kb/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress

0 Response to "The Uploaded File Exceeds the Upload_max_filesize Directive in Php.ini. Wordpress Thee"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel