Maximum file upload size depends on web hosting company you choose and the package you selected, you will see the limit in WordPress media upload page, Dashboard > Media > Add new. By default, its 2MB that is not enough to upload big media files like Audio/Video. So, I am going to show you how to fix this or increase maximum file upload size in WordPress.
Note: Deshi Hosting also using default functions, so you will get this limit to 2MB, to increase the limit please follow this tutorial or contact with our customer support.
Using php.ini or .user.ini file:
As you know cPanel updated recently, so file name will be different for older version and latest version of cPanel. For the old version we need to upload php.ini file and for the latest one we need to upload .user.ini text or content or functions will remain same for both, just the file name will be different.
Create a text file on your desktop and rename that text to php.ini or .user.ini. Again php.ini for older version of cPanel, user.ini is for latest version of cPanel. For Deshi Hosting we are using latest version of cPanel, PHP and MySQL versions, so for Deshi Hosting please use .user.ini file. After renaming this file open that file and paste these:
upload_max_filesize = 64M post_max_size = 64M memory_limit = 512M file_uploads = On max_execution_time = 300
When done we need to upload this file to cPanel (If you are advanced user you can do directly to cPanel, by creating a file, renaming and pasting these text.), for php.ini upload it to /wp-admin folder, for .user.ini upload it to root folder where your WordPress installed.
Using .htaccess File:
Though using .user.ini or php.ini file best option, if not works or if you don’t want to use .user.ini or php.ini file, we can use .htaccess file.
Login to cPanel or connect with FTP, then go to file manager, then go to root folder and find .htaccess (if you don’t find this file, look at the top there is a settings button then click on that button and select Show Hidden Files (dotfiles) and save it). Then find this file again, if we are not still getting this file, please create a file and rename it to .htaccess. then paste these codes (at the bottom) and save:
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300
Using Theme’s Functions File:
We can do these both from WordPress Dashboard or from cPanel/FTP. Login to your WordPress Dashboard > Appearance > Editor, find your theme’s functions.php and past this code (at the bottom):
@ini_set( 'upload_max_size' , '64M' ); @ini_set( 'post_max_size', '64M'); @ini_set( 'max_execution_time', '300' );
Recommendation:
We recommend to use .user.ini or php.ini file, this is easy and method. For Deshi Hosting please use .user.ini file. If you are still getting problem please contact with Deshi Hosting Support, they are very friendly, they will help you.