Max Upload Size

I really love WorfdPress…but one of the things I always struggle with is changing default values. Because there are so many, many places that you can make changes…which I presume means you can create conflicting values which lead to the changes you want to make being ignored.

I am currently trying to increase the max upload file size so I can upload media files larger than 2MB.

I’ve added the following to /etc/php/8.2/apache2/php.ini, /etc/php/8.2/fpm/php.ini, the site’s root php.ini file:

upload_max_filesize = 16M
post_max_size = 32M

Because you can’t have too much of a good thing, I also added the following to the site’s wp-config.php file:
`ini_set( ‘upload_max_size’ , ’16M’ );`
`ini_set( ‘post_max_size’, ’32M’);`

There are @ signs in front of each ini\_set, but for reasons I don’t feel like researching right now this particular markdown editor isn’t accepting them.

I’ve also restarted both apache2 and php8.2-fpm:

`sudo systemctl reload php8.2-fpm`
`sudo systemctl reload apache2`

And yet despite all these changes, the site stubbornly insists on showing the following (from Tools -> Site Health):

|| || |Max size of post data allowed|8M| |Max size of an uploaded file|2M| |Max effective file size|2 MB|

I’m sure there’s a simple answer that will make me feel like a complete idiot for not figuring it out…but what is it? 🙂

**Addendum 1**: the only version of PHP installed on the server is 8.2

**Addendum 2**:

Here’s the result of executing php\_info() in the index.php page for the site.

|Configuration File (php.ini) Path|/etc/php/8.2/fpm|
|Loaded Configuration File|/etc/php/8.2/fpm/php.ini|
|Scan this dir for additional .ini files|/etc/php/8.2/fpm/conf.d|
|Additional .ini files parsed|/etc/php/8.2/fpm/conf.d/10-mysqlnd.ini, /etc/php/8.2/fpm/conf.d/10-opcache.ini, /etc/php/8.2/fpm/conf.d/10-pdo.ini, /etc/php/8.2/fpm/conf.d/15-xml.ini, /etc/php/8.2/fpm/conf.d/20-calendar.ini, /etc/php/8.2/fpm/conf.d/20-ctype.ini, /etc/php/8.2/fpm/conf.d/20-curl.ini, /etc/php/8.2/fpm/conf.d/20-dom.ini, /etc/php/8.2/fpm/conf.d/20-exif.ini, /etc/php/8.2/fpm/conf.d/20-ffi.ini, /etc/php/8.2/fpm/conf.d/20-fileinfo.ini, /etc/php/8.2/fpm/conf.d/20-ftp.ini, /etc/php/8.2/fpm/conf.d/20-gd.ini, /etc/php/8.2/fpm/conf.d/20-gettext.ini, /etc/php/8.2/fpm/conf.d/20-iconv.ini, /etc/php/8.2/fpm/conf.d/20-imagick.ini, /etc/php/8.2/fpm/conf.d/20-intl.ini, /etc/php/8.2/fpm/conf.d/20-mbstring.ini, /etc/php/8.2/fpm/conf.d/20-mysqli.ini, /etc/php/8.2/fpm/conf.d/20-pdo\_mysql.ini, /etc/php/8.2/fpm/conf.d/20-phar.ini, /etc/php/8.2/fpm/conf.d/20-posix.ini, /etc/php/8.2/fpm/conf.d/20-readline.ini, /etc/php/8.2/fpm/conf.d/20-shmop.ini, /etc/php/8.2/fpm/conf.d/20-simplexml.ini, /etc/php/8.2/fpm/conf.d/20-sockets.ini, /etc/php/8.2/fpm/conf.d/20-sysvmsg.ini, /etc/php/8.2/fpm/conf.d/20-sysvsem.ini, /etc/php/8.2/fpm/conf.d/20-sysvshm.ini, /etc/php/8.2/fpm/conf.d/20-tokenizer.ini, /etc/php/8.2/fpm/conf.d/20-xmlreader.ini, /etc/php/8.2/fpm/conf.d/20-xmlwriter.ini, /etc/php/8.2/fpm/conf.d/20-xsl.ini, /etc/php/8.2/fpm/conf.d/20-zip.ini|

  1. If phpinfo() shows default values then you didn’t correctly set your php configuration file or maybe you’re accidentally configuring a different PHP version.

  2. >I’ve added the following to /etc/php/8.2/apache2/php.ini, /etc/php/8.2/fpm/php.ini, the site’s root php.ini file:

    I don’t believe those locations are your root directory. Where your wp-config file is should be your root directory. Create a new file where your wp-cong is and name it php.ini then add the code. Or if you have an .htaccess file you can add it there


  3. Are you hosted on WordPress .org
    Or do you have a hosting provider like hostinger and other?


This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer