Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHP 8.4 #294

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ As of now, we have several different PHP versions. Use appropriate php version a
- 8.1.x
- 8.2.x
- 8.3.x
- 8.4.x

## Installation

102 changes: 102 additions & 0 deletions bin/php84/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
FROM php:8.4-apache-bookworm

# Surpresses debconf complaints of trying to install apt packages interactively
# https://github.com/moby/moby/issues/4032#issuecomment-192327844

ARG DEBIAN_FRONTEND=noninteractive

# Update
RUN apt-get -y update --fix-missing && \
apt-get upgrade -y && \
apt-get --no-install-recommends install -y apt-utils && \
rm -rf /var/lib/apt/lists/*

RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini

# Install useful tools and install important libaries
RUN apt-get -y update && \
apt-get -y --no-install-recommends install nano wget \
dialog \
libsqlite3-dev \
libsqlite3-0 && \
apt-get -y --no-install-recommends install default-mysql-client \
zlib1g-dev \
libzip-dev \
libicu-dev && \
apt-get -y --no-install-recommends install --fix-missing apt-utils \
build-essential \
git \
curl \
libonig-dev \
fail2ban && \
apt-get install -y iputils-ping && \
apt-get -y --no-install-recommends install --fix-missing libcurl4 \
libcurl4-openssl-dev \
zip \
unzip \
openssl && \
rm -rf /var/lib/apt/lists/* && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# Install xdebug
RUN pecl install xdebug-3.4.1 && \
docker-php-ext-enable xdebug && \
mkdir /var/log/xdebug

# Install redis
RUN pecl install redis-6.1.0 && \
docker-php-ext-enable redis

# Install imagick
RUN apt-get update && \
apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \
rm -rf /var/lib/apt/lists/*

# Temporary fix for php84 https://github.com/Imagick/imagick/pull/690#issuecomment-2566064269
RUN cd /usr/local/src && \
git clone https://github.com/Imagick/imagick && \
cd imagick && \
git checkout master && \
phpize && \
./configure CPPFLAGS='-Dphp_strtolower=zend_str_tolower' && \
make && \
make install && \
cd .. && \
rm -rf imagick && \
docker-php-ext-enable imagick

# Other PHP8 Extensions

RUN docker-php-ext-install pdo_mysql && \
docker-php-ext-install pdo_sqlite && \
docker-php-ext-install bcmath && \
docker-php-ext-install mysqli && \
docker-php-ext-install curl && \
docker-php-ext-install zip && \
docker-php-ext-install -j$(nproc) intl && \
docker-php-ext-install mbstring && \
docker-php-ext-install gettext && \
docker-php-ext-install calendar && \
docker-php-ext-install exif


# Install Freetype
RUN apt-get -y update && \
apt-get --no-install-recommends install -y libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \
docker-php-ext-install gd

# Insure an SSL directory exists
RUN mkdir -p /etc/apache2/ssl

# Enable SSL support
RUN a2enmod ssl && a2enmod rewrite

# Enable apache modules
RUN a2enmod rewrite headers

# Cleanup
RUN rm -rf /usr/src/*
8 changes: 4 additions & 4 deletions dev_build_container.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ usage() {

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

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

exit
exit
4 changes: 2 additions & 2 deletions sample.env
Original file line number Diff line number Diff line change
@@ -4,8 +4,8 @@
# To determine the name of your containers
COMPOSE_PROJECT_NAME=lamp

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