Skip to content

Commit 536691f

Browse files
authored
Drop --with-pear with PHP 8.6 (#1654)
* Drop `--with-pear` with PHP 8.6 see #1554 * Drop now-obsolete oniguruma library
1 parent 56a27a7 commit 536691f

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

Dockerfile-linux.template

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
env.variant == "zts" # only needed for ZTS builds
2929
and is_alpine
3030
and IN(rcVersion; "8.2")
31+
;
32+
def install_pear_pecl:
33+
# https://github.com/docker-library/php/issues/1554
34+
IN(rcVersion; "8.2", "8.3", "8.4", "8.5")
3135
-}}
3236
FROM {{ env.from }}
3337

@@ -280,7 +284,7 @@ RUN set -eux; \
280284
# https://github.com/docker-library/php/issues/888
281285
"linux-headers",
282286
# oniguruma is part of mbstring in php 7.4+
283-
"oniguruma-dev"
287+
if install_pear_pecl then "oniguruma-dev" else empty end
284288
else
285289
# debian packages
286290
if env.variant == "apache" then "apache2-dev" else empty end,
@@ -293,7 +297,7 @@ RUN set -eux; \
293297
"libxml2-dev",
294298
"zlib1g-dev",
295299
# oniguruma is part of mbstring in php 7.4+
296-
"libonig-dev"
300+
if install_pear_pecl then "libonig-dev" else empty end
297301
end ] | sort[] | (
298302
-}}
299303
{{ . }} \
@@ -350,8 +354,10 @@ RUN set -eux; \
350354
# https://github.com/docker-library/php/issues/822
351355
--with-pic \
352356
\
357+
{{ if install_pear_pecl then ( -}}
353358
# --enable-mbstring is included here because otherwise there's no way to get pecl to use it properly (see https://github.com/docker-library/php/issues/195)
354359
--enable-mbstring \
360+
{{ ) else "" end -}}
355361
# --enable-mysqlnd is included here because it's harder to compile after the fact than extensions are (since it's a plugin for several extensions, not an extension in itself)
356362
--enable-mysqlnd \
357363
# https://wiki.php.net/rfc/argon2_password_hash
@@ -377,9 +383,11 @@ RUN set -eux; \
377383
--disable-phpdbg \
378384
{{ ) end -}}
379385
\
386+
{{ if install_pear_pecl then ( -}}
380387
# in PHP 7.4+, the pecl/pear installers are officially deprecated (requiring an explicit "--with-pear")
381388
--with-pear \
382389
\
390+
{{ ) else "" end -}}
383391
{{ if rcVersion | IN("8.2") then ( -}}
384392
# bundled pcre does not support JIT on riscv64 until 10.41 (php 8.3+)
385393
# https://github.com/PCRE2Project/pcre2/commits/pcre2-10.41/src/sljit/sljitNativeRISCV_64.c
@@ -476,10 +484,12 @@ RUN set -eux; \
476484
{{ clean_apt }}; \
477485
{{ ) end -}}
478486
\
487+
{{ if install_pear_pecl then ( -}}
479488
# update pecl channel definitions https://github.com/docker-library/php/issues/443
480489
pecl update-channels; \
481490
rm -rf /tmp/pear ~/.pearrc; \
482491
\
492+
{{ ) else "" end -}}
483493
# smoke test
484494
php --version
485495

0 commit comments

Comments
 (0)