The uploaded file exceeds the upload_max_filesize directive in php.ini


The-uploaded-file-exceeds-the-upload_max_filesize-banner

I will help you understand why the error message “The uploaded file exceeds the upload_max_filesize directive in php.ini” appears and how to have it fixed. Also, some hosting providers allow (WordPress default file upload size is 2 MB). then you can edit your .htaccess file to fix this issue.

Option 1: Editing the .htaccess file

1. Log in to your web hosting account and go to cPanel

2. Click on FILES -> File Manager

3. Select “Document Root for:” from the Directory Selection and click on Go. (Make sure the checkbox for Show Hidden Files is checked)

4. find the .httaccess file or edit the following code at the bottom.

 

php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value memory_limit 512M
php_value max_execution_time 180
php_value max_input_time 180

 

5. Save the changes you made to the .htaccess file

Option 2: Editing the wp-config.php file

Another way to amend the uploaded file exceeds the upload_max_filesize directive in php.ini error is by editing the wp-config.php file. It is located in your main WordPress directory.

Once opened, add this line before the “Happy blogging” part:

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

Now save the file, refresh your browser and try again.

 

Note: Note: if you can’t find the .htaccess file in your root directory, create a file and name it .htaccess. Also, you can edit the .htaccess and wp-config.php files through the Filezilla.

 

Well, I hope this article must have helped you. If you have any problem regarding this post just drop your comment here or you can also say “Thanks” simply.

Have fun!

Leave a Reply

Your email address will not be published. Required fields are marked *