我正在尝试在PHP的fpm配置中更改此值。
在这里,您可以看到我的简单docker-compose
文件:
version: '3.6'
services:
wordpress:
image: wordpress:${WORDPRESS_VERSION:-php7.3-fpm}
container_name: ${WORDPRESS_CONTAINER:-wordpress}
volumes:
- ./php/pool.d:/usr/local/etc/php-fpm.d
environment:
- WORDPRESS_DB_NAME=${WORDPRESS_DB_NAME:-wordpress}
- WORDPRESS_TABLE_PREFIX=${WORDPRESS_TABLE_PREFIX:-wp_}
- WORDPRESS_DB_HOST=${WORDPRESS_DB_HOST:-mysql}
- WORDPRESS_DB_USER=${WORDPRESS_DB_USER:-root}
- WORDPRESS_DB_PASSWORD=${WORDPRESS_DB_PASSWORD:-password}
depends_on:
- mysql
restart: always
...
在./php/pool.d/my-www.conf
内部,我只有:
pm = static
pm.max_children = 10
我得到了错误:
ERROR: [/usr/local/etc/php-fpm.d/my-www.conf:2] unknown entry 'pm'
如果我包含www
pool名称空间:
[www]
pm = static
pm.max_children = 10
我得到了错误:
ALERT: [pool www] user has not been defined
有什么想法吗?
答案 0 :(得分:1)
实际上,当您将目录挂载到docker-image的内部时(就像您执行的操作。./php/pool.d:/usr/local/etc/php-fpm.d)
version: '3.6'
services:
wordpress:
...
volumes:
- ./php/pool.d:/usr/local/etc/php-fpm.d
...
您替换了它。因此,除了池的一小部分像这样的东西之外,您没有池的配置
pm = static
pm.max_children = 10
因此,您会得到错误。为了解决这个问题,我可以提出两种方法:
version: '3.6'
services:
wordpress:
...
volumes:
- ./php/pool.d:/usr/local/etc/php-fpm.d
...
对此
version: '3.6'
services:
wordpress:
...
volumes:
- ./php/pool.d/www.conf:/usr/local/etc/php-fpm.d/www.conf
...
version: '3.6'
services:
wordpress:
...
volumes:
- ./php/pool.d/www2.conf:/usr/local/etc/php-fpm.d/www2.conf
...