Error while uploading: The uploaded file exceeds the upload_max_filesize directive in php.ini. Can’t upload more than 2M deafult.

If you have a self-hosted WordPress site with LAMP & Apache2 and using a multi-site configuration and it will not obey file size increase changes in php.ini, .htaccess or wp-config.php, stop and read below before you defenestrate:

You need to locate and edit this one file, it sets a global default.

/etc/php/7.4/apache2/php.ini

set post_max_size = 25M
upload_max_filesize = 25M

image

When you have finished, don’t forget to reload apache:

sudo systemctl reload apache2

Next, go to network admin –> settings and edit the desired size so long as it’s below the size set in php.ini

image

Leave a comment

Your email address will not be published. Required fields are marked *