Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't listen on socket #1564

Open
HA3MAK opened this issue Jan 29, 2025 · 1 comment
Open

Can't listen on socket #1564

HA3MAK opened this issue Jan 29, 2025 · 1 comment

Comments

@HA3MAK
Copy link

HA3MAK commented Jan 29, 2025

I'd like to use the php-fpm container with socket listener(more secure I think) instead of tcp. I run my instance like this:


docker run -d \
	-e TZ=${MY_TIMEZONE} \
	--name php-fpm-8.4 \
	--network ${DOCKER_NETWORK} \
	--restart=unless-stopped \
	-v ${DOCKER_CONTAINER_DIR}/htdocs:/srv/www \
	-v ${DOCKER_CONTAINER_DIR}/php/run:/run/php \
	-v ${DOCKER_CONTAINER_DIR}/php/my-fpm-pool.conf:/usr/local/etc/php-fpm.d/www.conf \
	php:8.4-fpm

So, I override the www.conf with my customized FPM pool config which contains a "listen = /run/php/php.sock". When the container started there was no socket. After several minutes I found the mistake in file /usr/local/etc/php-fpm.d/zz-docker.conf. It redefines the "www" pool listen setting to tcp. Contents of the file:

[global]
daemonize = no

[www]
listen = 9000

Why this file exists? Why is it needed to contain "listen = 9000"?

@tianon
Copy link
Member

tianon commented Jan 29, 2025

Good point -- we need to make sure daemonize = no is as late as possible, but listen = 9000 could be higher. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants