Skip to content

Commit 81dd4e4

Browse files
committed
feat: Added php-8.5 support
1 parent 3875ab8 commit 81dd4e4

File tree

10 files changed

+256
-4
lines changed

10 files changed

+256
-4
lines changed

.github/workflows/build-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
version: [73, 74, 80, 81, 82, 83, 84]
23+
version: [73, 74, 80, 81, 82, 83, 84, 85]
2424
with:
2525
image: php${{ matrix.version }}
2626
context: ./php

.github/workflows/scan-images.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
- image: php82
2727
- image: php83
2828
- image: php84
29+
- image: php85
2930
permissions:
3031
contents: read
3132
security-events: write

.github/workflows/validate-config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: true
1616
matrix:
17-
php-version: ['8.4', '5.5']
17+
php-version: ['8.5', '5.5']
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Although this project started as a development environment for Totara Learn it c
1414
### What You Get
1515
* [NGINX](https://nginx.org/) as a webserver
1616
* [Apache](https://httpd.apache.org/) as a webserver
17-
* [PHP](http://php.net/) 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4 to test for different versions
17+
* [PHP](http://php.net/) 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 to test for different versions
1818
* [PostgreSQL](https://www.postgresql.org/) (9.3, 9.6, 10, 11, 12, 13, 14, 15, 16, 17),
1919
* [MariaDB](https://mariadb.org/) (10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.11, 11.4, 11.8),
2020
* [MySQL](https://www.mysql.com/) (5.7, 8.0, 8.4),

compose/apache.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ services:
8686
- totara84.behat
8787
- totara84.behat.debug
8888
- totara84.behat.totaralms.com
89+
- totara85
90+
- totara85.debug
91+
- totara85.behat
92+
- totara85.behat.debug
93+
- totara85.behat.totaralms.com
94+
8995

9096
volumes:
9197
totara-data:

compose/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,19 @@ services:
112112
args:
113113
TIME_ZONE: ${TIME_ZONE}
114114

115+
php-8.5:
116+
build:
117+
context: ./php
118+
dockerfile: php85/Dockerfile
119+
args:
120+
TIME_ZONE: ${TIME_ZONE}
121+
122+
php-8.5-debug:
123+
build:
124+
context: ./php
125+
dockerfile: php85/Dockerfile
126+
args:
127+
TIME_ZONE: ${TIME_ZONE}
128+
115129
# php-X.X: ...
116130
# php-X.X-debug: ...

compose/nginx.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@ services:
8787
- totara84.behat
8888
- totara84.behat.debug
8989
- totara84.behat.totaralms.com
90-
90+
- totara85
91+
- totara85.debug
92+
- totara85.behat
93+
- totara85.behat.debug
94+
- totara85.behat.totaralms.com
95+
9196
volumes:
9297
totara-data:
9398
coverage-report:

compose/php.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,57 @@ services:
370370
networks:
371371
- totara
372372

373+
php-8.5:
374+
image: ghcr.io/totara/docker-dev-php85
375+
container_name: totara_php85
376+
working_dir: ${REMOTE_SRC}
377+
environment:
378+
CONTAINERNAME: php-8.5
379+
CRON_CONTAINER: ${CRON_CONTAINER:-none}
380+
HIST_FILE: /root/.bash_history
381+
DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message
382+
USE_ZSH_NERDFONT: ${USE_ZSH_NERDFONT:-0}
383+
volumes:
384+
- ${LOCAL_SRC}:${REMOTE_SRC}
385+
- totara-data:${REMOTE_DATA}
386+
- ./cron.d:/etc/cron.d
387+
- ./php/includes:/var/www/totara/includes
388+
- coverage-report:/var/www/totara/coverage-report
389+
- bash-history:/root/.bash_history
390+
- zsh-history:/root/.zsh_history
391+
- ./shell:/root/custom_shell
392+
depends_on:
393+
- php-8.5-debug
394+
networks:
395+
- totara
396+
397+
php-8.5-debug:
398+
image: ghcr.io/totara/docker-dev-php85
399+
container_name: totara_php85_debug
400+
working_dir: ${REMOTE_SRC}
401+
environment:
402+
CONTAINERNAME: php-8.5-debug
403+
CRON_CONTAINER: ${CRON_CONTAINER:-none}
404+
TZ: ${TIME_ZONE}
405+
XDEBUG_CONFIG: client_host=${HOST_IP}
406+
XDEBUG_MODE: debug
407+
XDEBUG_SESSION: totara85
408+
PHP_IDE_CONFIG: serverName=totara85
409+
HIST_FILE: /root/.bash_history
410+
DISABLE_AUTO_UPDATE: "true" # disables oh-my-zsh update message
411+
USE_ZSH_NERDFONT: ${USE_ZSH_NERDFONT:-0}
412+
volumes:
413+
- ${LOCAL_SRC}:${REMOTE_SRC}
414+
- totara-data:${REMOTE_DATA}
415+
- ./cron.d:/etc/cron.d
416+
- ./php/includes:/var/www/totara/includes
417+
- coverage-report:/var/www/totara/coverage-report
418+
- bash-history:/root/.bash_history
419+
- zsh-history:/root/.zsh_history
420+
- ./shell:/root/custom_shell
421+
networks:
422+
- totara
423+
373424
# php-X.X: ...
374425
# php-X.X-debug: ...
375426

compose/sync.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ services:
107107
volumes:
108108
- totara-www-sync:${REMOTE_SRC}:nocopy
109109

110+
php-8.5:
111+
volumes:
112+
- totara-www-sync:${REMOTE_SRC}:nocopy
113+
114+
php-8.5-debug:
115+
volumes:
116+
- totara-www-sync:${REMOTE_SRC}:nocopy
117+
110118
# php-X.X: ...
111119
# php-X.X-debug: ...
112120

php/php85/Dockerfile

Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
FROM php:8.5-fpm-bookworm
2+
3+
ARG TIME_ZONE=Pacific/Auckland
4+
5+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
6+
apt-transport-https \
7+
libfreetype6-dev \
8+
libjpeg62-turbo-dev \
9+
libwebp-dev \
10+
libmcrypt-dev \
11+
libpng-dev \
12+
libxml2-dev \
13+
libicu-dev \
14+
libpq-dev \
15+
gnupg2 \
16+
cron \
17+
nano \
18+
vim \
19+
wget \
20+
openssl \
21+
locales \
22+
tzdata \
23+
git \
24+
libzip-dev \
25+
libmemcached-dev \
26+
zip \
27+
netcat-traditional \
28+
bc \
29+
ghostscript \
30+
graphviz \
31+
aspell \
32+
libldap2-dev \
33+
libltdl-dev \
34+
libc-client-dev \
35+
libkrb5-dev \
36+
libssl-dev \
37+
libpspell-dev \
38+
xmlstarlet \
39+
libtool \
40+
bison
41+
42+
COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie
43+
44+
RUN docker-php-ext-install -j$(nproc) \
45+
zip \
46+
intl \
47+
soap \
48+
pdo_pgsql \
49+
pdo_mysql \
50+
pgsql \
51+
mysqli \
52+
exif \
53+
ldap \
54+
&& docker-php-ext-configure gd \
55+
--with-freetype \
56+
--with-jpeg \
57+
--with-webp \
58+
&& docker-php-ext-install -j$(nproc) gd
59+
60+
RUN git clone https://github.com/longxinH/xhprof.git ./xhprof \
61+
&& cd xhprof \
62+
&& git checkout v2.3.10 \
63+
&& cd extension/ \
64+
&& phpize \
65+
&& ./configure \
66+
&& make && make install
67+
68+
RUN echo "extension=xhprof.so" >> /usr/local/etc/php/conf.d/xhprof.ini \
69+
&& echo "xhprof.output_dir = /tmp/xhprof" >> /usr/local/etc/php/conf.d/xhprof.ini
70+
71+
RUN pecl channel-update pecl.php.net && \
72+
pecl install -o -f redis \
73+
&& rm -rf /tmp/pear \
74+
&& docker-php-ext-enable redis
75+
76+
# TODO: uncomment when igbinary supports PHP 8.5 https://pecl.php.net/package/igbinary
77+
# RUN pecl channel-update pecl.php.net && \
78+
# pecl install -o -f igbinary \
79+
# && rm -rf /tmp/pear \
80+
# && docker-php-ext-enable igbinary
81+
82+
RUN pecl channel-update pecl.php.net && \
83+
pecl install -o -f memcached \
84+
&& rm -rf /tmp/pear \
85+
&& docker-php-ext-enable memcached
86+
87+
RUN pecl channel-update pecl.php.net && \
88+
pecl install -o -f imap \
89+
&& rm -rf /tmp/pear \
90+
&& docker-php-ext-enable imap
91+
92+
RUN pecl channel-update pecl.php.net && \
93+
pecl install -o -f excimer \
94+
&& rm -rf /tmp/pear \
95+
&& docker-php-ext-enable excimer
96+
97+
RUN pecl channel-update pecl.php.net && \
98+
pecl install -o -f pspell \
99+
&& rm -rf /tmp/pear \
100+
&& docker-php-ext-enable pspell
101+
102+
# TODO: switch to non alpha when xdebug supports PHP 8.5 https://xdebug.org/announcements/2025-11-12
103+
RUN pie install xdebug/xdebug:3.5.0alpha3
104+
105+
RUN pecl channel-update pecl.php.net && \
106+
pecl install -o -f pcov \
107+
&& rm -rf /tmp/pear \
108+
&& docker-php-ext-enable pcov
109+
110+
# Install composer
111+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
112+
113+
# we need en_US locales for MSSQL connection to work
114+
# we need en_AU locales for behat to work
115+
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
116+
sed -i -e 's/# en_AU.UTF-8 UTF-8/en_AU.UTF-8 UTF-8/' /etc/locale.gen && \
117+
dpkg-reconfigure --frontend=noninteractive locales && \
118+
update-locale LANG=en_US.UTF-8
119+
120+
ENV LANG=en_US.UTF-8
121+
ENV LANGUAGE=en_US.UTF-8
122+
ENV LC_ALL=en_US.UTF-8
123+
124+
# install mssql extension
125+
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
126+
&& curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \
127+
&& apt-get update && ACCEPT_EULA=Y apt-get install -y \
128+
msodbcsql18 \
129+
mssql-tools18 \
130+
unixodbc-dev
131+
132+
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \
133+
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
134+
135+
# TODO: uncomment when sqlsrv supports PHP 8.5 https://github.com/microsoft/msphpsql/releases
136+
# Workaround applied: https://github.com/microsoft/msphpsql/issues/1438#issuecomment-1444773949
137+
# RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system \
138+
# && pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 || \
139+
# apt-get install -y --allow-downgrades odbcinst=2.3.7 odbcinst1debian2=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 && \
140+
# pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0
141+
142+
# RUN docker-php-ext-enable sqlsrv.so && docker-php-ext-enable pdo_sqlsrv.so
143+
144+
RUN ln -fs /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \
145+
&& dpkg-reconfigure --frontend noninteractive tzdata
146+
147+
COPY config/php.ini /usr/local/etc/php/
148+
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf
149+
150+
# Source each .sh file found in the /shell/ folder, always source the default_aliases.sh file first
151+
RUN echo 'if [[ -e "/root/custom_shell/default-aliases.sh" ]]; then source "/root/custom_shell/default-aliases.sh"; fi' >> ~/.bashrc && \
152+
echo 'for f in /root/custom_shell/*.sh; do [[ "$f" != "/root/custom_shell/default-aliases.sh" && -e "$f" ]] && source "$f"; done;' >> ~/.bashrc
153+
154+
# Have the option of using the oh my zsh shell.
155+
RUN apt-get update && apt-get install -y zsh
156+
RUN sh -c "$(curl https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
157+
RUN git clone https://github.com/romkatv/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k
158+
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
159+
RUN git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions
160+
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting
161+
RUN echo 'setopt +o nomatch' > ~/.zshrc
162+
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc
163+
RUN cat ~/.bashrc >> ~/.zshrc
164+
165+
COPY entrypoint.sh /entrypoint.sh
166+
RUN chmod +x /entrypoint.sh
167+
ENTRYPOINT [ "/entrypoint.sh" ]

0 commit comments

Comments
 (0)