Dockerfile icon indicating copy to clipboard operation
Dockerfile copied to clipboard

how to increase upload_max_filesize on php-apache image

Open yuseferi opened this issue 3 years ago • 2 comments

Hi there, I'm using https://github.com/webdevops/Dockerfile/tree/5fca0e66f2af9f06d04fa778281fb886e67d434f/docker/php-apache/7.4/conf Dockerfile/docker/php-apache/7.4/conf/

I don't see any config for PHP on the that.

I'm wondering how can I increase upload_max_filesize ?

thanks

yuseferi avatar Jul 23 '21 09:07 yuseferi

Hi You can use env file to achieve that like this.

inside docker-compose file, add env_file to www part:

  www:
    depends_on:
    - mysql
    - mail
    image: webdevops/php-apache:7.4
    volumes:
    - "./www:/var/www/html"
    ports:
    - 8080:80
    env_file:
    - .env

then inside .env file you can increase upload_max_filesize and other settings like this:

upload_max_filesize=64M
post_max_size=64M
max_execution_time=100
memory_limit=128M

Good luck

alizamani avatar Jul 23 '21 10:07 alizamani

HI @alizamani

thank you very much for your attention and reply.

I don't have a docker-compose file ( because the image has been created for an Azure container base).

The specific question is how we can increase it in the docker build process not in compose step.

Thanks Yusef

yuseferi avatar Jul 23 '21 11:07 yuseferi