Skip to content

Commit 7b439a3

Browse files
committed
Use PHP_INI_DIR provided by the php base images
1 parent ee43abe commit 7b439a3

File tree

36 files changed

+170
-103
lines changed

36 files changed

+170
-103
lines changed

Dockerfile.template

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,20 @@ RUN set -ex; \
133133
# set recommended PHP.ini settings
134134
{{ if env.version != "cli" then ( -}}
135135
# see https://secure.php.net/manual/en/opcache.installation.php
136+
# enabled by default in the php images: https://github.com/docker-library/php/pull/1587
136137
RUN set -eux; \
137138
{ \
138139
echo 'opcache.memory_consumption=128'; \
139140
echo 'opcache.interned_strings_buffer=8'; \
140141
echo 'opcache.max_accelerated_files=4000'; \
141142
echo 'opcache.revalidate_freq=2'; \
142-
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
143+
} > "$PHP_INI_DIR/conf.d/opcache-recommended.ini"
143144
{{ ) else ( -}}
144145
# excluding opcache due https://github.com/docker-library/wordpress/issues/407
145146
{{ ) end -}}
146147
# https://wordpress.org/support/article/editing-wp-config-php/#configure-error-logging
147-
RUN { \
148+
RUN set -eux; \
149+
{ \
148150
# https://www.php.net/manual/en/errorfunc.constants.php
149151
# https://github.com/docker-library/wordpress/issues/420#issuecomment-517839670
150152
echo 'error_reporting = E_ERROR | E_WARNING | E_PARSE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_RECOVERABLE_ERROR'; \
@@ -156,7 +158,7 @@ RUN { \
156158
echo 'ignore_repeated_errors = On'; \
157159
echo 'ignore_repeated_source = Off'; \
158160
echo 'html_errors = Off'; \
159-
} > /usr/local/etc/php/conf.d/error-logging.ini
161+
} > "$PHP_INI_DIR/conf.d/error-logging.ini"
160162
{{ if env.variant == "apache" then ( -}}
161163

162164
RUN set -eux; \

beta/php8.1/apache/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.1/fpm-alpine/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.1/fpm/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.2/apache/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.2/fpm-alpine/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.2/fpm/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.3/apache/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.3/fpm-alpine/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

beta/php8.3/fpm/Dockerfile

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)