File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ RUN dnf --assumeyes module reset php
1919RUN dnf --assumeyes --nogpgcheck module install php:remi-${PHP_VERSION}
2020RUN dnf --assumeyes install php-pdo
2121RUN dnf --assumeyes install php-mysqlnd
22+ RUN if [ "$(printf '%s\n' "${PHP_VERSION}" "8.5" | sort -V | head -n1)" != "8.5" ]; then \
23+ dnf --assumeyes install php-opcache || true; \
24+ fi
2225RUN yum install -y mod_php nginx php-fpm procps-ng mysql-server
2326
2427
Original file line number Diff line number Diff line change @@ -27,15 +27,16 @@ RUN apt-get update
2727
2828RUN set -eux; \
2929 PHP_PKG="php${PHP_VERSION}"; \
30- apt-get install -y --no-install-recommends \
31- nginx \
32- apache2 \
33- mariadb-server \
30+ # Build package list - PHP 8.5+ has opcache bundled, so skip the separate opcache package \
31+ PACKAGES="nginx apache2 mariadb-server \
3432 ${PHP_PKG} ${PHP_PKG}-cli ${PHP_PKG}-common ${PHP_PKG}-fpm \
3533 ${PHP_PKG}-curl ${PHP_PKG}-sqlite3 ${PHP_PKG}-mysql \
36- ${PHP_PKG}-mbstring ${PHP_PKG}-xml ${PHP_PKG}-zip ${PHP_PKG}-opcache \
37- libapache2-mod-php${PHP_VERSION} \
38- ; \
34+ ${PHP_PKG}-mbstring ${PHP_PKG}-xml ${PHP_PKG}-zip \
35+ libapache2-mod-php${PHP_VERSION}"; \
36+ if [ "$(printf '%s\n' "${PHP_VERSION}" "8.5" | sort -V | head -n1)" != "8.5" ]; then \
37+ PACKAGES="${PACKAGES} ${PHP_PKG}-opcache"; \
38+ fi; \
39+ apt-get install -y --no-install-recommends ${PACKAGES} \
3940 # Apache: switch to prefork for mod_php scenario and enable rewrite
4041 a2dismod mpm_event || true; \
4142 a2dismod mpm_worker || true; \
You can’t perform that action at this time.
0 commit comments