Laravel Sail Post Content Rength上的Docker上的PhpMyAdmin超过了极限
我在Mac X Big Sur上的Sail在Docker上有一个Laravel环境。我在我的docker-compose.yml文件中添加了一个phpmyadmin,这一切都在起作用,但是当我尝试将数据导入数据库时,我会得到:
Warning: POST Content-Length of 68109047 bytes exceeds the limit of 2097152 bytes in Unknown on line 0
我将Docker配置文件发布到我的Laravel Project并重新启动Docker。这是我的docker-composer.yml:
version: '3'
services:
laravel.test:
build:
context: ./docker/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.1/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'sail-mysql:/var/lib/mysql'
networks:
- sail
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
myadmin:
image: 'phpmyadmin:latest'
ports:
- 8080:80
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
links:
- "mysql:db"
depends_on:
- mysql
networks:
- sail
networks:
sail:
driver: bridge
volumes:
sail-mysql:
driver: local
在docker/8.1/php.ini中,
post_max_size = 100M
upload_max_filesize = 100M
variables_order = EGPCS
但仍然没有运气。我还尝试在提示下运行此命令:
sail php -a
phpinfo();
揭示了这一点:
Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /etc/php/8.1/cli/php.ini
但是我的 /etc文件夹中没有PHP文件夹。我还在Docker/8.1/dockerfile的Docker配置中注意到了这一点,
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini
RUN chmod +x /usr/local/bin/start-container
但同样,没有/etc/php文件夹
I have a Laravel environment running on Docker via Sail on Mac OS X Big Sur. I added a phpmyadmin to my docker-compose.yml file and it's all working, but when I try to import my data to the database, I get:
Warning: POST Content-Length of 68109047 bytes exceeds the limit of 2097152 bytes in Unknown on line 0
I published the docker config files to my Laravel project and restarted docker. Here's my docker-composer.yml:
version: '3'
services:
laravel.test:
build:
context: ./docker/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.1/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'sail-mysql:/var/lib/mysql'
networks:
- sail
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
retries: 3
timeout: 5s
myadmin:
image: 'phpmyadmin:latest'
ports:
- 8080:80
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
links:
- "mysql:db"
depends_on:
- mysql
networks:
- sail
networks:
sail:
driver: bridge
volumes:
sail-mysql:
driver: local
and in docker/8.1/php.ini
post_max_size = 100M
upload_max_filesize = 100M
variables_order = EGPCS
But still no luck. I also tried running this command and then at the prompt:
sail php -a
phpinfo();
Which revealed this:
Configuration File (php.ini) Path => /etc/php/8.1/cli
Loaded Configuration File => /etc/php/8.1/cli/php.ini
But there is no php folder in my /etc folder. I also noticed this in my docker config at docker/8.1/Dockerfile
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini
RUN chmod +x /usr/local/bin/start-container
But again, there is no /etc/php folder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 https://hub.docker.com/_/phpmyadmin 您需要在您的中指定docker-compose.yml将环境变量upload_limit归档到您所需的限制。例如。
以便上传限制为100.000.000字节。
According to https://hub.docker.com/_/phpmyadmin you need to specify in your docker-compose.yml file the environment variable UPLOAD_LIMIT to your desired limit. Eg.
so as to have an upload limit of 100.000.000 bytes.
这个答案不正确。
指定限制为100000字节!那就是97,66kb。
This answer is not correct.
specifies an limit of 100000 Bytes! So that is 97,66kB.
您可以更轻松地编写upload_limit:8m
You can more easily write UPLOAD_LIMIT: 8M