You Are Here...

how-to-increase-max-file-size

How to Increase the Maximum Upload and PHP Memory Limit

TThemes September 28, 2017 No Comments

You can increase the MAximum Upload file size and PHP Memory limit with the following method.

1- Updating Your php.ini File.

If you use cPanel, go to the Files section and click on the File Manager button. Make sure the checkbox for Show Hidden Files is checked and then click Go.

Select your wp-admin folder and find a file called php.ini or php5.ini. If you don’t see it, create one by clicking the New File button in the top left-hand corner. Name the file php.ini and click the Create File button on the pop-up.

If you follow these instructions and it still doesn’t work, try renaming the file to php5.ini. Once the file is open, add or edit the following lines and then save and close.

upload_max_filesize = 1000M
post_max_size = 2000M
memory_limit = 3000M
file_uploads = On
max_execution_time = 180

The M means megabytes. Change the 1000M, 2000M and 3000M limit to the value with which you feel most comfortable. Changing the value of max_execution_time will limit the amount of time spent loading a script in seconds.

In many cases, the values you enter should get larger as you go down the list from lines one to three. The upload_max_filesize should be the smallest while memory_limit should be the largest. The median should be post_max_size.

2- Editing Your .htaccess File

If that addition to your php.ini file doesn’t do the trick, try editing your .htaccess file and add or edit the following code at the very bottom:

php_value upload_max_filesize 1000M
php_value post_max_size 2000M
php_value memory_limit 3000M
php_value max_execution_time 180
php_value max_input_time 180

Editing this code is similar to your php.ini file. Change the values to limits that best suit your needs. Don’t forget to save when you’re done and clear the cache for your browser.

3- Amending Your wp-config.php File

If both of these are a no-go, try editing your wp-config.php file, adding the following to the very bottom, but just before the “happy blogging” line:

define('WP_MEMORY_LIMIT', '3000M');

Tags

Leave a Reply