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

How to reload php.ini in php-fpm without restarting container #399

Closed
Dublerq opened this issue Mar 28, 2017 · 2 comments
Closed

How to reload php.ini in php-fpm without restarting container #399

Dublerq opened this issue Mar 28, 2017 · 2 comments

Comments

@Dublerq
Copy link

Dublerq commented Mar 28, 2017

How can I reload php.ini from files that were edited after the container was started? Solution posted on stack overflow is quite ugly because we lose the feature that container goes down along with php-fpm.

@estahn
Copy link

estahn commented Mar 28, 2017

@Dublerq php-fpm is a process manager which supports the USER2 signal, which is used to reload the config file.

From inside the container:

kill -USR2 1

Outside:

docker exec -it <mycontainer> kill -USR2 1

Complete example:

docker run -d --name test123 php:7.1-fpm-alpine
docker exec -it test123 ps aux
docker exec -it test123 kill -USR2 1
docker exec -it test123 ps aux

@jinrenjie
Copy link

If you have similar problems:

$ docker exec -it CONTAINER kill -USR2 1

OCI runtime exec failed: exec failed: container_linux.go:370: starting container process caused: exec: "kill": executable file not found in $PATH: unknown

You can using this command to reload php process:

docker exec -it CONTAINER bash -c "kill -USR2 1

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

3 participants