From fc9010c86294bbfd490980ecf7c8f154e4a1b272 Mon Sep 17 00:00:00 2001 From: tdferreira <49493150+tdferreira@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:06:12 +0000 Subject: [PATCH 1/3] Add PHP 8.4 --- README.md | 1 + bin/php84/Dockerfile | 102 +++++++++++++++++++++++++++++++++++++++++ dev_build_container.sh | 8 ++-- sample.env | 2 +- 4 files changed, 108 insertions(+), 5 deletions(-) create mode 100644 bin/php84/Dockerfile mode change 100755 => 100644 dev_build_container.sh diff --git a/README.md b/README.md index 127c17789f..2c298288ff 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/php84/Dockerfile b/bin/php84/Dockerfile new file mode 100644 index 0000000000..02b51522e9 --- /dev/null +++ b/bin/php84/Dockerfile @@ -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.0 && \ + 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/* diff --git a/dev_build_container.sh b/dev_build_container.sh old mode 100755 new mode 100644 index 3efb2f0b75..afe2fdfafe --- a/dev_build_container.sh +++ b/dev_build_container.sh @@ -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 \ No newline at end of file +exit diff --git a/sample.env b/sample.env index e1df9da174..5e2de5d769 100644 --- a/sample.env +++ b/sample.env @@ -5,7 +5,7 @@ COMPOSE_PROJECT_NAME=lamp # Possible values: php54, php56, php71, php72, php73, php74, php8, php81, php82, php83 -PHPVERSION=php83 +PHPVERSION=php84 DOCUMENT_ROOT=./www APACHE_DOCUMENT_ROOT=/var/www/html VHOSTS_DIR=./config/vhosts From ca4a4515f86972e3a3b1b4803c5f46521697cd3a Mon Sep 17 00:00:00 2001 From: tdferreira <49493150+tdferreira@users.noreply.github.com> Date: Mon, 13 Jan 2025 10:50:53 +0000 Subject: [PATCH 2/3] Added missing php84 value --- sample.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample.env b/sample.env index 5e2de5d769..87f8803603 100644 --- a/sample.env +++ b/sample.env @@ -4,7 +4,7 @@ # To determine the name of your containers COMPOSE_PROJECT_NAME=lamp -# Possible values: php54, php56, php71, php72, php73, php74, php8, php81, php82, 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 From 9d75d5674ec9f663f35a17e410917d5eaca5f316 Mon Sep 17 00:00:00 2001 From: tdferreira <49493150+tdferreira@users.noreply.github.com> Date: Thu, 20 Feb 2025 11:12:55 +0000 Subject: [PATCH 3/3] Updated Xdebug to latest version --- bin/php84/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/php84/Dockerfile b/bin/php84/Dockerfile index 02b51522e9..8b19ec76e4 100644 --- a/bin/php84/Dockerfile +++ b/bin/php84/Dockerfile @@ -39,7 +39,7 @@ openssl && \ curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer # Install xdebug -RUN pecl install xdebug-3.4.0 && \ +RUN pecl install xdebug-3.4.1 && \ docker-php-ext-enable xdebug && \ mkdir /var/log/xdebug