Docker:PhpMyAdmin的上传限制为2048KiB [英] Docker: PhpMyAdmin has an upload limit of 2048KiB

查看:706
本文介绍了Docker:PhpMyAdmin的上传限制为2048KiB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个看起来像这样的docker-compose.yml:

i have a docker-compose.yml that looks like this:

webserver:
  build: ./_docker/php
  ports:
    - 80:80
  links:
    - mysql
  volumes_from:
    - app

mysql:
  image: mysql:5.7
  environment:
    MYSQL_DATABASE: "${DB_NAME}"
    MYSQL_USER: "${DB_USER}"
    MYSQL_ROOT_PASSWORD: "${DB_ROOT_PW}"
    MYSQL_PASSWORD: "${DB_PW}"
  volumes:
    - ./_docker/data/db:/docker-entrypoint-initdb.d
  volumes_from:
    - data

data:
  image: mysql:5.7
  volumes:
    - /var/lib/mysql
  command: "true"

phpmyadmin:
  image: phpmyadmin/phpmyadmin
  ports:
    - 8080:80
  links:
    - mysql
  environment:
    PMA_HOST: mysql

app:
  image: tianon/true
  volumes:
    - .:/var/www/public_html

Dockerfile看起来像这样:

Dockerfile looking like this:

FROM php:7.0-apache
#php:7.2.2-apache
#php:5.6.33-apache

COPY php.ini /usr/local/etc/php/

COPY 000-default.conf /etc/apache2/sites-available/

RUN a2enmod rewrite
RUN a2enmod expires
RUN a2enmod headers

RUN apt-get update
RUN apt-get install -y zlib1g-dev libxml2-dev libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12.0 imagemagick
RUN docker-php-ext-install mysqli zip soap
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install gd

# Install opcache
RUN docker-php-ext-install opcache

和php ini如下:

and the php ini like this:

max_input_vars = 1500
max_execution_time = 300
post_max_size=50M
upload_max_filesize=50M

当我启动容器,我的Web服务器位于 http:// localhost

when i start the container i have my webserver located on http://localhost.

i pu t里面有 phpinfo(); index.php 并显示 php.ini 有效。

i put an index.php with a phpinfo(); inside it and it shows, that the php.ini works.

当我打开 http:// localhost:8080 并登录到PMA时,显示我的上传限制设置为2048KiB。

When i open http://localhost:8080 and login to PMA it shows me that my upload limit i set to 2048KiB.

我在哪里可以更改?

请先感谢!

推荐答案

在Docker中像这样UPLOAD_LIMIT env一样使用。这是从我的docker-compose.yml中获得的。默认情况下,它以字节为单位,因此3000000000约为3000MB。

Use like this UPLOAD_LIMIT env in docker. This is from my docker-compose.yml. It counts in Bytes by default so 3000000000 will be around 3000MB.

 phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: 'php7.3-phpmyadmin'
    restart: 'always'
    links:
      - mysql
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      UPLOAD_LIMIT: 3000000000
    ports:
      - '8082:80'
    volumes:
      - /sessions

这篇关于Docker:PhpMyAdmin的上传限制为2048KiB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆