Skip to content

Commit 5e70b79

Browse files
committed
Readd fpm
1 parent c74b132 commit 5e70b79

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

tests/dockerfiles/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ RUN set -eux; \
126126
\
127127
# https://github.com/docker-library/php/issues/439
128128
--with-mhash \
129+
--enable-fpm \
130+
--with-fpm-user=www-data \
131+
--with-fpm-group=www-data \
129132
\
130133
# https://github.com/docker-library/php/issues/822
131134
--with-pic \
@@ -191,6 +194,50 @@ RUN set -eux; \
191194
# smoke test
192195
php --version
193196

197+
RUN set -eux; \
198+
cd /usr/local/etc; \
199+
if [ -d php-fpm.d ]; then \
200+
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
201+
sed 's!=NONE/!=!g' php-fpm.conf.default | tee php-fpm.conf > /dev/null; \
202+
cp php-fpm.d/www.conf.default php-fpm.d/www.conf; \
203+
else \
204+
# PHP 5.x doesn't use "include=" by default, so we'll create our own simple config that mimics PHP 7+ for consistency
205+
mkdir php-fpm.d; \
206+
cp php-fpm.conf.default php-fpm.d/www.conf; \
207+
{ \
208+
echo '[global]'; \
209+
echo 'include=etc/php-fpm.d/*.conf'; \
210+
} | tee php-fpm.conf; \
211+
fi; \
212+
{ \
213+
echo '[global]'; \
214+
echo 'error_log = /proc/self/fd/2'; \
215+
echo; echo '; https://github.com/docker-library/php/pull/725#issuecomment-443540114'; echo 'log_limit = 8192'; \
216+
echo; \
217+
echo '[www]'; \
218+
echo '; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.'; \
219+
echo '; https://bugs.php.net/bug.php?id=73886'; \
220+
echo 'access.log = /proc/self/fd/2'; \
221+
echo; \
222+
echo 'clear_env = no'; \
223+
echo; \
224+
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
225+
echo 'catch_workers_output = yes'; \
226+
echo 'decorate_workers_output = no'; \
227+
} | tee php-fpm.d/docker.conf; \
228+
{ \
229+
echo '[global]'; \
230+
echo 'daemonize = no'; \
231+
echo; \
232+
echo '[www]'; \
233+
echo 'listen = 9000'; \
234+
} | tee php-fpm.d/zz-docker.conf; \
235+
mkdir -p "$PHP_INI_DIR/conf.d"; \
236+
{ \
237+
echo '; https://github.com/docker-library/php/issues/878#issuecomment-938595965'; \
238+
echo 'fastcgi.logging = Off'; \
239+
} > "$PHP_INI_DIR/conf.d/docker-fpm.ini"
240+
194241
COPY tests/dockerfiles/docker-php-* /usr/local/bin/
195242
ADD https://raw.githubusercontent.com/php/php-src/refs/heads/PHP-8.4/.gdbinit /root/.gdbinit
196243

0 commit comments

Comments
 (0)