Commit 88f822b
docker: drop runtime PHP scan-dir discovery for env var + apk path glob
The previous build-time discovery via PHP_CONFIG_FILE_SCAN_DIR worked
but invoked a PHP binary just to learn a path that's already a stable
contract of each base image:
* php:8-apache exports PHP_INI_DIR=/usr/local/etc/php as part of the
docker-library image template, stable across PHP majors. Reference
it directly in the COPY destination — no RUN, no validation needed.
* Alpine's apk php-apache2 always installs mod_php's conf.d at
/etc/phpXX/conf.d (currently /etc/php84). The FROM php:8-alpine
image also ships its own PHP at /usr/local/etc/php/conf.d, but
mod_php doesn't read from there. Glob /etc/php*/conf.d to track
the apk-installed PHP major automatically; explicit error if the
glob matches nothing.
Net effect: Debian goes from a 5-line RUN block to a 1-line COPY.
Alpine keeps a small RUN block but no longer invokes a PHP binary,
so it doesn't matter which of the two PHP installs `php` resolves
to via $PATH.
Verified: both variants build, install the override at the right
conf.d, mod_php reports post_max_size=32M, and a 20 MB POST to
/backend/empty.php returns HTTP 200 / 0 bytes with no warnings.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent d088379 commit 88f822b
2 files changed
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
27 | 31 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
32 | 43 | | |
33 | 44 | | |
34 | 45 | | |
| |||
0 commit comments