Hi all,
I’ve been working on testing migrating a previous install of wordpress to a docker container in a virtual environment in preparation to possibly do that to the live version of the site. I’m trying to just install the Updraft Plus plugin (if you aren’t familiar, its a widely used backup/migration solution for wordpress), and add the generated backup files to the virtual containerized wordpress instance. Installing the plugin works, but trying to drag and drop the files isn’t. I’m getting the following pop-up:
Upload error (code -200) : HTTP Error. (HTTP code: 413)
The file failed to upload. Please check the following:
- Any settings in your .htaccess or web.config file that affects the maximum upload or post size.
- The available memory on the server.
- That you are attempting to upload a zip file previously created by UpdraftPlus.
Further information may be found in the browser JavaScript console, and the server PHP error logs.
I’ve looked up the issue elsewhere and found a number of possible solutions, most involving volumes of modified files (dunno if that’s the right way of saying it). Here’s my docker-compose (which is mostly adapted from this Digital Ocean tutorial:
version: '3'
services:
db:
image: mysql:8.0
container_name: db
restart: unless-stopped
env_file: .env
environment:
- MYSQL_DATABASE=wordpress
volumes:
- dbdata:/var/lib/mysql
command: '--default-authentication-plugin=mysql_native_password'
networks:
- app-network
wordpress:
depends_on:
- db
image: wordpress:5.8.3-fpm-alpine
container_name: wordpress
restart: unless-stopped
env_file: .env
environment:
- WORDPRESS_DB_HOST=db:3306
- WORDPRESS_DB_USER=$MYSQL_USER
- WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD
- WORDPRESS_DB_NAME=wordpress
volumes:
- wordpress:/var/www/html
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
- ./.htaccess:/var/html/www/.htaccess
networks:
- app-network
webserver:
depends_on:
- wordpress
image: nginx:1.21.5-alpine
container_name: webserver
restart: unless-stopped
ports:
- "80:80"
volumes:
- wordpress:/var/www/html
- ./nginx-conf:/etc/nginx/conf.d
#- certbot-etc:/etc/letsencrypt
networks:
- app-network
volumes:
dbdata:
wordpress:
nginx:
networks:
app-network:
driver: bridge
The upload.ini:
file_uploads = On
memory_limit = 500M
upload_max_filesize = 100M
post_max_size = 250M
max_execution_time = 600
The .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
php_value upload_max_filesize 500M
php_value post_max_size 500M
So yeah, I’m trying to increase the filesize limit (the biggest file I’m trying to upload to the wordpress is 20 megabytes). Has anyone run into this and/or can help? I’d really appreciate it.