Increase Max Upload Size for Wordpress uploads

Docker Container

This document explains some docker knowledge (like exec into a container's shell). You can ignore these if you deploy to bare metal

docker exec -it wp-williamusic-wordpress /bin/bash

# root@b082e6c9c8f4:/var/www/html
php -i | grep upload_max_filesize
upload_max_filesize => 2M => 2M
nano ./php/uploads.ini
upload_max_filesize = 512M
post_max_size = 512M
memory_limit = 512M
max_execution_time = 300
max_input_time = 300
nano compose.yml
services:
  wordpress:
    volumes:
      - ./php/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
docker compose down
docker compose up -d
Rebuild or Pull new Image

If the config isn't taking, you may need to rebuild the image or just pull for latest update.

# root@b082e6c9c8f4:/var/www/html - docker wp container
php -i | grep upload_max_filesize
upload_max_filesize => 512M => 512M

Credit