docker-library/drupal

Changing the filesize for uploads

Closed this issue · 2 comments

I've basically been fighting with this for two days and cannot seem to find the correct way to change the allowed size of uploads or post-size for the php running in the docker container. I've checked /admin/reports/status/php I find that:

Loaded Configuration File | /usr/local/etc/php/php.ini. This file contains this:
memory_limit 256M
upload_max_filesize 128M
post_max_size 128M
max_execution_time 300
max_input_time 1000
I have restarted the docker container, however this does not seem to take effect, as the status-page shows this:

upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M

I'd higly appreciate any suggestions on what I might be doing wrong here, because I've searched high and low and nothing seems to affect this at all.

This is roughly what my Dockerfile looks like (that extends the drupal image):

FROM drupal:8

RUN { \
    echo 'upload_max_filesize=50M'; \
    echo 'post_max_size=50M'; \
  } > /usr/local/etc/php/conf.d/uploads.ini

That adds a PHP conf file at /usr/local/etc/php/conf.d/uploads.ini with upload_max_filesize and post_max_size set to allow up to 50 megabytes.

Hope that helps!

THANK YOU! It helped me tremendously! I don't know if you know why it helped me, but reading your configuration, I noticed my missing "=". I've been staring blindly at those lines of configuration for any spelling mistakes, but never noticed the missing chars. It works like a charm now.