1
votes

I'm running a WordPress site (not MU), I have set upload_max_filesize = 50M, post_max_size=50M in php.ini. The results of phpinfo() function show the value to be 50M but in WordPress Media uploader Max upload file size is still 32M.

I have also tried to write this code in the theme's functions.php:

@ini_set( 'upload_max_size' , '50M' );
@ini_set( 'post_max_size', '50M');

Also tried deactivating all plugins, changed theme but no resort, WordPress still says 32 Mb.

Can anyone guide me what can be wrong here?

4
did you had any luck with this? - RZKY
Yes! Turns out the web host had applied a hard limit on these parameters. No matter what I'd do it won't go beyond 32M. I moved away from GoDaddy. - Pramod Jodhani

4 Answers

4
votes

There are many ways to achieve what you need , here are three ways you can use any one of these

1) Using functions file: Copy and paste the code below to functions.php file

@ini_set( 'upload_max_filesize' , '50M' );
@ini_set( 'post_max_size', '50M');
@ini_set( 'max_execution_time', '300' );

2) Try using htaccess method by adding the code below:

php_value upload_max_filesize 50M
php_value post_max_size 50M
php_value max_execution_time 300
php_value max_input_time 300

3) Last method, php.ini file that you are already trying

upload_max_filesize = 50M
post_max_size = 50M
max_execution_time = 300

Hope it helps !

2
votes

I had the same problem, and the other answers didn't completely work for me, and I'm apparently not alone, so here's what I did to make it work.

  1. Locate your php.ini files: sudo find / -name "php*.ini" -print. This will give you an idea of where any configuration files might be hiding.
  2. Open them one at a time (you may need sudo).
  3. Check to see if they have a line "upload_max_filesize=##" where ## is some value (i.e. 250M). You shouldn't have to add any of the lines. This should already be in the file.
  4. You will need to change the line "post_max_size=##" to be greater than or equal to upload_max_filesize.

Notes:

Supposedly, you can do "php -i | grep php.ini" to see which configuration file is being used, but changing the indicated file did not work for me. I changed one that lived at /etc/php5/apache2/php.ini to make it work. Some trial and error will be needed, but give this a shot.

1
votes

There are a lot of people having this problem the best way to fix it is by creating a new php.ini inside your wp-admin folder.

1.Connect to your site via FTP or File Manager 2.Navigate to wp-admin folder 3.Create a file inside the wp-admin folder called php.ini 4.Add in this line: max_input_vars = 5000 5.Save

I wrote a quick blog article on it here too: Increasing Your Max_input_vars Value

1
votes

This was absolute insanity. I almost went crazy looking for a solution.

My wp-admin/php.ini was getting completely ignored.
I changed /etc/apache2/php/7.4/cli/php.ini, still nothing, it was getting ignored.
Turns out it was getting settings from /etc/php/7.4/apache2/php.ini.