- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我正在尝试将 Dockerized Wordpress 实例的上传限制设置为 150M。
[filename] 超出了此站点的最大上传大小。
我创建了一个 uploads.ini
文件并将其按卷附加到实例。然而,我仍然无法让 Wordpress 媒体 uploader 增加它的限制。
Docker-compose.yml:
version: '2'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password1
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: password1
wordpress:
depends_on:
- db
build: ./wordpress
ports:
- "8085:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_PASSWORD: password1
volumes:
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
db_data:
上传.ini:
file_uploads = On
memory_limit = 500M
upload_max_filesize = 500M
post_max_size = 500M
max_execution_time = 600
Docker 检查容器:
[
{
"Id": "8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f",
"Created": "2017-03-15T23:47:54.480206792Z",
"Path": "docker-entrypoint.sh",
"Args": [
"apache2-foreground"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 15956,
"ExitCode": 0,
"Error": "",
"StartedAt": "2017-03-16T17:46:30.075247017Z",
"FinishedAt": "2017-03-16T17:46:29.700791339Z"
},
"Image": "sha256:cfe94722592e66629527d7fc1546174916c758c6945eb9911506077e76c4d00e",
"ResolvConfPath": "/var/lib/docker/containers/8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f/hostname",
"HostsPath": "/var/lib/docker/containers/8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f/hosts",
"LogPath": "/var/lib/docker/containers/8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f/8edc91a51bf8480edc927de2fa5c16624ac43a7beb58c109cd771a143f67746f-json.log",
"Name": "/edgeofrevolt_wordpress_1",
"RestartCount": 0,
"Driver": "aufs",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"8efe40659ebd3e44b17d45f1dd2aac20f12e13a4513e41520d6c2a1b1f01aa08"
],
"HostConfig": {
"Binds": [
"/root/NginxDockerProxyPass/edgeofrevolt/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini:rw",
"374db2645434a23b92074b6d95935361948397519f2d5a531986bb925ceb0f53:/var/www/html:rw"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "edgeofrevolt_default",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "8085"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Name": "aufs",
"Data": null
},
"Mounts": [
{
"Source": "/root/NginxDockerProxyPass/edgeofrevolt/uploads.ini",
"Destination": "/usr/local/etc/php/conf.d/uploads.ini",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
{
"Name": "374db2645434a23b92074b6d95935361948397519f2d5a531986bb925ceb0f53",
"Source": "/var/lib/docker/volumes/374db2645434a23b92074b6d95935361948397519f2d5a531986bb925ceb0f53/_data",
"Destination": "/var/www/html",
"Driver": "local",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "8edc91a51bf8",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"affinity:container==6797730d5702955f114fd260628b82615aa7702d0cafae7dae456b1806009437",
"WORDPRESS_DB_HOST=db:3306",
"WORDPRESS_DB_PASSWORD=p0kem0n2468Y",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"PHPIZE_DEPS=autoconf \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c",
"PHP_INI_DIR=/usr/local/etc/php",
"APACHE_CONFDIR=/etc/apache2",
"APACHE_ENVVARS=/etc/apache2/envvars",
"PHP_EXTRA_BUILD_DEPS=apache2-dev",
"PHP_EXTRA_CONFIGURE_ARGS=--with-apxs2",
"PHP_CFLAGS=-fstack-protector-strong -fpic -fpie -O2",
"PHP_CPPFLAGS=-fstack-protector-strong -fpic -fpie -O2",
"PHP_LDFLAGS=-Wl,-O1 -Wl,--hash-style=both -pie",
"GPG_KEYS=0BD78B5F97500D450838F95DFE857D9A90D90EC1 6E4F6AB321FDC07F2C332E3AC2BF0BC433CFC8B3",
"PHP_VERSION=5.6.30",
"PHP_URL=https://secure.php.net/get/php-5.6.30.tar.xz/from/this/mirror",
"PHP_ASC_URL=https://secure.php.net/get/php-5.6.30.tar.xz.asc/from/this/mirror",
"PHP_SHA256=a363185c786432f75e3c7ff956b49c3369c3f6906a6b10459f8d1ddc22f70805",
"PHP_MD5=68753955a8964ae49064c6424f81eb3e",
"WORDPRESS_VERSION=4.7.2",
"WORDPRESS_SHA1=7b687f1af589c337124e6247229af209ec1d52c3"
],
"Cmd": [
"apache2-foreground"
],
"Image": "edgeofrevolt_wordpress",
"Volumes": {
"/usr/local/etc/php/conf.d/uploads.ini": {},
"/var/www/html": {}
},
"WorkingDir": "/var/www/html",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "da7c1855141bc762874ddd4734f2b062556a041750ff48a3cfa3954bb7dfed6c",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "edgeofrevolt",
"com.docker.compose.service": "wordpress",
"com.docker.compose.version": "1.8.1"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "ceec8d1498a6988b4cc56ad10afa5cf87e0670d030460efbd26bd5ace185a375",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8085"
}
]
},
"SandboxKey": "/var/run/docker/netns/ceec8d1498a6",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"edgeofrevolt_default": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"wordpress",
"8edc91a51bf8"
],
"NetworkID": "89bde3d402cc2fe938279c30415cc2947f92205e610dff1acba69101440b90e7",
"EndpointID": "916db2fab99a1637aef87aa1f05fb702fb9b6d3692bf04a9bf46bf122fe9e990",
"Gateway": "172.23.0.1",
"IPAddress": "172.23.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:17:00:03"
}
}
}
}
]
编辑:“upload_max_filesize”中有错字
最佳答案
它对我有用,如下所示:我用以下几行在 docker-compose.yml
旁边创建了 uploads.ini
。这正是它在第一篇文章中所说的。
file_uploads = On
memory_limit = 500M
upload_max_filesize = 500M
post_max_size = 500M
max_execution_time = 600
之后我添加了
volumes:
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
到我在第一篇文章中所述的 .yml 文件。
在此之后我不得不删除容器/图像(基本上从头开始):
docker stop [image name]
docker rm [image name]
docker image rm [image name]
有些地方我最终会使用 ID 插入图像名称。名称或 ID 基本上你必须停止,删除容器和图像。底线是从头开始,在您的 .yml 文件中添加一行,如第一篇文章中所述。请记住,您将失去所有的 wp 工作。现在运行
docker-compose up -d --build
现在应该提高上传限制。更改后,我能够上传新的更大主题。不再有上传文件大小错误。唯一的问题是,如果您需要在工作过程中增加此上传大小限制,那么您将如何做到这一点?...
关于Wordpress Docker 不会增加上传限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42983276/
尝试使用集成到 QTCreator 的表单编辑器,但即使我将插件放入 QtCreator.app/Contents/MacOS/designer 也不会显示。不过,相同的 dylib 文件确实适用于独
在此代码示例中。 “this.method2();”之后会读到什么?在返回returnedValue之前会跳转到method2()吗? public int method1(int returnedV
我的项目有通过gradle配置的依赖项。我想添加以下依赖项: compile group: 'org.restlet.jse', name: 'org.restlet.ext.apispark', v
我将把我们基于 Windows 的客户管理软件移植到基于 Web 的软件。我发现 polymer 可能是一种选择。 但是,对于我们的使用,我们找不到 polymer 组件具有表格 View 、下拉菜单
我的项目文件夹 Project 中有一个文件夹,比如 ED 文件夹,当我在 Eclipse 中指定在哪里查找我写入的文件时 File file = new File("ED/text.txt"); e
这是奇怪的事情,这个有效: $('#box').css({"backgroundPosition": "0px 250px"}); 但这不起作用,它只是不改变位置: $('#box').animate
这个问题在这里已经有了答案: Why does OR 0 round numbers in Javascript? (3 个答案) 关闭 5 年前。 Mozilla JavaScript Guide
这个问题在这里已经有了答案: Is the function strcmpi in the C standard libary of ISO? (3 个答案) 关闭 8 年前。 我有一个问题,为什么
我目前使用的是共享主机方案,我不确定它使用的是哪个版本的 MySQL,但它似乎不支持 DATETIMEOFFSET 类型。 是否存在支持 DATETIMEOFFSET 的 MySQL 版本?或者有计划
研究 Seam 3,我发现 Seam Solder 允许将 @Named 注释应用于包 - 在这种情况下,该包中的所有 bean 都将自动命名,就好像它们符合条件一样@Named 他们自己。我没有看到
我知道 .append 偶尔会增加数组的容量并形成数组的新副本,但 .removeLast 会逆转这种情况并减少容量通过复制到一个新的更小的数组来改变数组? 最佳答案 否(或者至少如果是,则它是一个错
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
noexcept 函数说明符是否旨在 boost 性能,因为生成的对象中可能没有记录异常的代码,因此应尽可能将其添加到函数声明和定义中?我首先想到了可调用对象的包装器,其中 noexcept 可能会产
我正在使用 Angularjs 1.3.7,刚刚发现 Promise.all 在成功响应后不会更新 angularjs View ,而 $q.all 会。由于 Promises 包含在 native
我最近发现了这段JavaScript代码: Math.random() * 0x1000000 10.12345 10.12345 >> 0 10 > 10.12345 >>> 0 10 我使用
我正在编写一个玩具(物理)矢量库,并且遇到了 GHC 坚持认为函数应该具有 Integer 的问题。是他们的类型。我希望向量乘以向量以及标量(仅使用 * ),虽然这可以通过仅使用 Vector 来实现
PHP 的 mail() 函数发送邮件正常,但 Swiftmailer 的 Swift_MailTransport 不起作用! 这有效: mail('user@example.com', 'test
我尝试通过 php 脚本转储我的数据,但没有命令行。所以我用 this script 创建了我的 .sql 文件然后我尝试使用我的脚本: $link = mysql_connect($host, $u
使用 python 2.6.4 中的 sqlite3 标准库,以下查询在 sqlite3 命令行上运行良好: select segmentid, node_t, start, number,title
我最近发现了这段JavaScript代码: Math.random() * 0x1000000 10.12345 10.12345 >> 0 10 > 10.12345 >>> 0 10 我使用
我是一名优秀的程序员,十分优秀!