Php: How to reload php.ini in php-fpm without restarting container

Created on 28 Mar 2017  路  1Comment  路  Source: docker-library/php

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.

Most helpful comment

@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

>All comments

@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
Was this page helpful?
0 / 5 - 0 ratings

Related issues

nojimage picture nojimage  路  3Comments

ambroisemaupate picture ambroisemaupate  路  3Comments

dhoeric picture dhoeric  路  4Comments

mikk150 picture mikk150  路  3Comments

ihorsamusenko picture ihorsamusenko  路  4Comments