If File Upload Php Exceeded Php.ini Upload_max_filesize
Introduction
The Uploaded file exceeds the upload_max_filesize directive in php.ini error in WordPress, occurs when uploading big files, themes, or images. The issue is the event of a server-side setting that limits file sizes.
This guide provides half dozen (6) solutions on how to adjust the appropriate parameters and resolve the file size mistake.

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
- Access to a command-line/last window (optional)
six Ways to Gear up Uploaded File Exceeds upload_max_filesize error in WordPress
Use the WordPress dashboard to check your electric current maximum upload file size. Select the Media > Add New choice, as shown in the image below.

In this instance, the maximum file size is limited to 232 MB. Information technology is not possible to change this setting using WordPress. We provided six uncomplicated solutions on how to configure maximum file size on your server.
Pick 1: Edit the .htaccess File (cPanel)
1. Open cPanel and launch the file manager.
2. Right-click the .htaccess file, and so click edit.
Note: If you are not able to locate the .htaccess file, you may need to click Settings in the upper-right corner and bank check the box to show hidden files.
three. Explore the file and find 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 leave the file.
Option 2: Edit the .htaccess File using Control Line Interface
one. Access the server that hosts your WordPress site.
two. Enter the following control in your Command Line Interface to admission the WordPress directory:
cd /path/to/wordpress
Annotation: The /path/to/wordpress is an example. You need to enter the correct path to your WordPress directory.
three. Open the .htaccess file with a text editor of your choice. In this case, nosotros used the nano text editor:
sudo nano .htaccess
four. Explore the file and find the line php_value upload_max_filesize. Edit the line and define the size you need:
php_value_upload_max_filesize 256M
This teaching changes the server-side limit on the size of the file yous are immune to upload to 256 MB.
5. Salvage the changes and leave 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 straight:
1. Access the public_html folder using cPanel.
2. Find the wp-config.php file. Correct-click the file and select the edit option.

Whorl nearly to the finish of the file and detect for the following comment line:
/* That'due south all, stop editing! Happy blogging. */
three. Add together the following code just above that line:
@ini_set('upload_max_size' , '256M' );
4. Save the file and exit. Try to upload your file again.
Option iv: Edit the wp-config.php File from Control Line Interface
1. Access the server that hosts your WordPress site.
2. Enter the post-obit control and access the WordPress directory:
cd /path/to/wordpress
3. Open the wp-config.php file with a text editor of your choice.
sudo nano wp-config.php
4. Notice for the post-obit comment line:
/* That'southward all, stop editing! Happy blogging. */

5. Add the following line just to a higher place:
@ini_set('upload_max_size' , '256M' );
vi. Save the file and exit.
Option five: 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. Admission the Command Line Interface, and enter the following:
cd /etc/php/seven.0/cli
Annotation: If you're running a different version of PHP, make sure to supersede seven.0 with the version you lot are currently using.
three. Utilize a text editor to open the php.ini file:
sudo nano php.ini
4. Locate the following line:
upload_max_filesize = 100M
five. Replace 100M with a higher value in megabytes. (256 MB for example)

This file allows you to configure other settings too:
- memory_limit 256M – Sets the max amount of retention a script tin can use.
- post_max_size 32M – Sets the max size for the total of the POST body information.
- 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.
vi. Relieve the file and exit.
Test your file upload in WordPress – the effect with file size is now resolved.
Option half dozen: Contact Host's Back up
It is not uncommon for hosting companies to ready limitations on the settings clients tin edit themselves. Depending on your item hosting visitor, you might not be able to perform some of the actions described in the previous steps.
In those cases, it might be necessary to contact your host'due south support services. Most hosts perform this type of configuration as part of their standard service.
Conclusion
At present y'all know how to ready the error "The uploaded file exceeds the upload_max_filesize directive in php.ini." in WordPress. This tutorial covered half-dozen different methods to increase the maximum file upload size.
Regardless of the called method, past following these elementary instructions, yous are at present able to define the maximum file size when uploading files to your website.
Was this article helpful?
Yeah No
Source: https://phoenixnap.com/kb/fix-the-uploaded-file-exceeds-the-upload-max-filesize-directive-in-php-ini-wordpress#:~:text=Contact%20Host's%20Support-,The%20Uploaded%20file%20exceeds%20the%20upload_max_filesize%20directive%20in%20php.,setting%20that%20limits%20file%20sizes.
0 Response to "If File Upload Php Exceeded Php.ini Upload_max_filesize"
Enregistrer un commentaire