gpt4 book ai didi

php - Docker:PhpMyAdmin的上传限制为2048KiB

转载 作者:行者123 更新时间:2023-12-02 17:37:29 25 4
gpt4 key购买 nike

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

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看起来像这样:
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是这样的:
max_input_vars = 1500
max_execution_time = 300
post_max_size=50M
upload_max_filesize=50M

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

我在里面放了一个 index.phpphpinfo();,它表明 php.ini有效。

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

我在哪里可以更改?

提前致谢!

最佳答案

在docker中使用像UPLOAD_LIMIT env这样的环境。这是从我的docker-compose.yml中获得的。 UPLOAD_LIMIT的默认值为2048K,即2048KiB。将值设置为300M会将其增加到300MiB。
引用:https://github.com/phpmyadmin/docker#environment-variables-summary

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

关于php - Docker:PhpMyAdmin的上传限制为2048KiB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58868237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com