Question

How To Increase WordPress Media File Size

By baldwinjackson ·
Hello everyone I am looking for some solution to increase WordPress media file size as I am currently using shared hosting which only allow 2MB file only. I am followed couple of different tutorial still I am unable to achieve this task.
2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Ways To Increase the Maximum Upload File Size

by jamesmehraa In reply to How To Increase WordPress ...

1. Create Or Modify PHP.Ini File
PHP.ini contains the PHP configuration for your server. You can find it in the root directory of your server. Go to your hosting root directory and search for php.ini file. Due to security reasons, it might be hidden, so don’t forget to check “Show hidden files”.
Open php.ini file with any text editor and search for the three settings to modify them according to your requirement. We’ll use the following numbers for this example:
File size to be uploaded: 20MB.
upload_max_filesize = 25MB
post_max_size = 27MB
memory_limit = 30MB

2. Create Or Modify .Htaccess
.htaccess is an important file and contains various configurations for your server. Most hosting providers keep it hidden though. To modify it, you need to check “Show Hidden Files” once again and locate .htaccess file within the root directory of your server.
Open it with any editor and paste these three lines at the end of the file where it says #END WordPress:
php_value upload_max_filesize 25MB
php_value post_max_size 27MB
php_value memory_limit 30MB

3.Modifying A WordPress File
If the above two methods didn’t work for you, there is always an alternative. You can paste the following 3 lines within your WordPress files. These lines can be written in wp-config.php, themes functions.php file etc. However, this is not the recommended way to increase upload file size limit.
@ini_set( ‘upload_max_size’ , ’25MB’ );
@ini_set( ‘post_max_size’, ’27MB’);
@ini_set( ‘memory_limit’, ’30MB’ );

Collapse -

Code to increase media file size

by tamil1996 In reply to How To Increase WordPress ...

upload_max_filesize=64M
post_max_size=64M
max_execution_time=300
You should paste this code in Wp config file

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums