Skip to content

Commit 5c9c79c

Browse files
Merge pull request #294 from tdferreira/feature/add-php84
Add PHP 8.4
2 parents 3e51913 + 67149fa commit 5c9c79c

File tree

4 files changed

+108
-6
lines changed

4 files changed

+108
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ As of now, we have several different PHP versions. Use appropriate php version a
2222
- 8.1.x
2323
- 8.2.x
2424
- 8.3.x
25+
- 8.4.x
2526

2627
## Installation
2728

bin/php84/Dockerfile

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
FROM php:8.4-apache-bookworm
2+
3+
# Surpresses debconf complaints of trying to install apt packages interactively
4+
# https://github.com/moby/moby/issues/4032#issuecomment-192327844
5+
6+
ARG DEBIAN_FRONTEND=noninteractive
7+
8+
# Update
9+
RUN apt-get -y update --fix-missing && \
10+
apt-get upgrade -y && \
11+
apt-get --no-install-recommends install -y apt-utils && \
12+
rm -rf /var/lib/apt/lists/*
13+
14+
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
15+
16+
# Install useful tools and install important libaries
17+
RUN apt-get -y update && \
18+
apt-get -y --no-install-recommends install nano wget \
19+
dialog \
20+
libsqlite3-dev \
21+
libsqlite3-0 && \
22+
apt-get -y --no-install-recommends install default-mysql-client \
23+
zlib1g-dev \
24+
libzip-dev \
25+
libicu-dev && \
26+
apt-get -y --no-install-recommends install --fix-missing apt-utils \
27+
build-essential \
28+
git \
29+
curl \
30+
libonig-dev \
31+
fail2ban && \
32+
apt-get install -y iputils-ping && \
33+
apt-get -y --no-install-recommends install --fix-missing libcurl4 \
34+
libcurl4-openssl-dev \
35+
zip \
36+
unzip \
37+
openssl && \
38+
rm -rf /var/lib/apt/lists/* && \
39+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
40+
41+
# Install xdebug
42+
RUN pecl install xdebug-3.4.5 && \
43+
docker-php-ext-enable xdebug && \
44+
mkdir /var/log/xdebug
45+
46+
# Install redis
47+
RUN pecl install redis-6.2.0 && \
48+
docker-php-ext-enable redis
49+
50+
# Install imagick
51+
RUN apt-get update && \
52+
apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \
53+
rm -rf /var/lib/apt/lists/*
54+
55+
RUN cd /usr/local/src && \
56+
git clone https://github.com/Imagick/imagick && \
57+
cd imagick && \
58+
git checkout master && \
59+
phpize && \
60+
./configure && \
61+
make && \
62+
make install && \
63+
cd .. && \
64+
rm -rf imagick && \
65+
docker-php-ext-enable imagick
66+
67+
# Other PHP8 Extensions
68+
69+
RUN docker-php-ext-install pdo_mysql && \
70+
docker-php-ext-install pdo_sqlite && \
71+
docker-php-ext-install bcmath && \
72+
docker-php-ext-install mysqli && \
73+
docker-php-ext-install curl && \
74+
docker-php-ext-install zip && \
75+
docker-php-ext-install -j$(nproc) intl && \
76+
docker-php-ext-install mbstring && \
77+
docker-php-ext-install gettext && \
78+
docker-php-ext-install calendar && \
79+
docker-php-ext-install exif
80+
81+
82+
# Install Freetype
83+
RUN apt-get -y update && \
84+
apt-get --no-install-recommends install -y libfreetype6-dev \
85+
libjpeg62-turbo-dev \
86+
libpng-dev && \
87+
rm -rf /var/lib/apt/lists/* && \
88+
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \
89+
docker-php-ext-install gd
90+
91+
# Insure an SSL directory exists
92+
RUN mkdir -p /etc/apache2/ssl
93+
94+
# Enable SSL support
95+
RUN a2enmod ssl && a2enmod rewrite
96+
97+
# Enable apache modules
98+
RUN a2enmod rewrite headers
99+
100+
# Cleanup
101+
RUN rm -rf /usr/src/*

dev_build_container.sh

100755100644
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ usage() {
2525

2626
echo "Usage:"
2727
echo " -b = build all container variations of specified version"
28-
echo " valid values are: php54, php56, php71, php72, php73, php74, php8, php81, php82"
28+
echo " valid values are: php54, php56, php71, php72, php73, php74, php8, php81, php82, php83, php84"
2929
echo -e " \nAttention: !!! SCRIPT REMOVES ALL DATA IN 'data/mysql/*' !!!"
3030
}
3131

@@ -39,7 +39,7 @@ build () {
3939
echo -e "### cleaning old mysql data"
4040
rm -rf ./data/mysql/*
4141
echo -e "### building ./buildtarget/$buildtarget-$version.env \n"
42-
$dc --env-file ./buildtest/$buildtarget-$version.env up -d --build
42+
$dc --env-file ./buildtest/$buildtarget-$version.env up -d --build --force-recreate
4343
# wait for mysql to initialize
4444
sleep 30
4545
# check definitions
@@ -125,7 +125,7 @@ if [ "$buildtarget" == 'php54' ]||[ "$buildtarget" == 'php56' ]||[ "$buildtarget
125125
build "$buildtarget" "$version"
126126
cleanup
127127
done
128-
elif [ "$buildtarget" == 'php74' ]||[ "$buildtarget" == 'php8' ]||[ "$buildtarget" == 'php81' ] || [ "$buildtarget" == 'php82' ] || [ "$buildtarget" == 'php83' ] ; then
128+
elif [ "$buildtarget" == 'php74' ]||[ "$buildtarget" == 'php8' ]||[ "$buildtarget" == 'php81' ] || [ "$buildtarget" == 'php82' ] || [ "$buildtarget" == 'php83' ] || [ "$buildtarget" == 'php84' ] ; then
129129
for version in "${dbarr[@]}"
130130
do
131131
checkdep
@@ -139,4 +139,4 @@ else
139139
usage
140140
fi
141141

142-
exit
142+
exit

sample.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# To determine the name of your containers
55
COMPOSE_PROJECT_NAME=lamp
66

7-
# Possible values: php54, php56, php71, php72, php73, php74, php8, php81, php82, php83
8-
PHPVERSION=php83
7+
# Possible values: php54, php56, php71, php72, php73, php74, php8, php81, php82, php83, php84
8+
PHPVERSION=php84
99
DOCUMENT_ROOT=./www
1010
APACHE_DOCUMENT_ROOT=/var/www/html
1111
VHOSTS_DIR=./config/vhosts

0 commit comments

Comments
 (0)