diff --git a/layers/bootstrap.php b/layers/bootstrap.php index 505c3171..383fc187 100644 --- a/layers/bootstrap.php +++ b/layers/bootstrap.php @@ -2,11 +2,15 @@ $appRoot = getenv('LAMBDA_TASK_ROOT'); -if (getenv('BREF_AUTOLOAD_PATH')) { - require getenv('BREF_AUTOLOAD_PATH'); -} elseif (file_exists($appRoot . '/vendor/autoload.php')) { - require $appRoot . '/vendor/autoload.php'; +$autoloadPath = $_SERVER['BREF_AUTOLOAD_PATH'] ?? null; +if (! $autoloadPath) { + $autoloadPath = $appRoot . '/vendor/autoload.php'; } +if (! file_exists($autoloadPath)) { + throw new RuntimeException('Could not find the Composer vendor directory. Did you run "composer require bref/bref"? Read https://bref.sh/docs/environment/php#custom-vendor-path if your Composer vendor directory is in a custom path.'); +} + +require $autoloadPath; $runtimeClass = getenv('RUNTIME_CLASS'); diff --git a/layers/fpm-dev/Dockerfile b/layers/fpm-dev/Dockerfile index 58bf2a64..a0e55afd 100644 --- a/layers/fpm-dev/Dockerfile +++ b/layers/fpm-dev/Dockerfile @@ -10,8 +10,8 @@ ARG PHP_VERSION RUN mkdir -p /opt/bref/extensions # Install xdebug -RUN if [ $PHP_VERSION != "84" ]; then pecl install xdebug; fi -RUN if [ $PHP_VERSION != "84" ]; then cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions; fi +RUN pecl install xdebug-3.4.2 +RUN cp $(php -r "echo ini_get('extension_dir');")/xdebug.so /opt/bref/extensions # Install Blackfire # https://blackfire.io/docs/up-and-running/installation?action=install&mode=full&version=latest&mode=full&location=server&os=manual&language=php#install-the-php-probe diff --git a/php-80/Dockerfile b/php-80/Dockerfile index 11b6a79d..9eb58925 100644 --- a/php-80/Dockerfile +++ b/php-80/Dockerfile @@ -120,6 +120,7 @@ RUN CFLAGS="" \ --openssldir=${INSTALL_DIR}/bref/ssl \ --release \ enable-tls1_3 \ + enable-legacy \ no-tests \ shared \ zlib @@ -173,7 +174,7 @@ RUN make install \ # - OpenSSL # Needed by: # - curl -ENV VERSION_LIBSSH2=1.11.0 +ENV VERSION_LIBSSH2=1.11.1 ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 RUN set -xe; \ mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ @@ -206,7 +207,7 @@ RUN cmake --build . --target install # - libxml2 # Needed by: # - curl -ENV VERSION_NGHTTP2=1.62.1 +ENV VERSION_NGHTTP2=1.65.0 ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 RUN set -xe; \ mkdir -p ${NGHTTP2_BUILD_DIR}; \ @@ -253,7 +254,7 @@ RUN make -j $(nproc) && make install # # - libnghttp2 # # Needed by: # # - php -ENV VERSION_CURL=8.9.1 +ENV VERSION_CURL=8.12.1 ENV CURL_BUILD_DIR=${BUILD_DIR}/curl RUN set -xe; \ mkdir -p ${CURL_BUILD_DIR}/bin; \ @@ -293,7 +294,7 @@ RUN make install # https://github.com/nih-at/libzip/releases # Needed by: # - php -ENV VERSION_ZIP=1.10.1 +ENV VERSION_ZIP=1.11.3 ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip RUN set -xe; \ mkdir -p ${ZIP_BUILD_DIR}/bin/; \ @@ -336,7 +337,7 @@ RUN make install # - OpenSSL # Needed by: # - php -ENV VERSION_POSTGRES=16.3 +ENV VERSION_POSTGRES=17.4 ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres RUN set -xe; \ mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ @@ -362,7 +363,7 @@ RUN cd ${POSTGRES_BUILD_DIR}/src/include && make install # https://github.com/kkos/oniguruma/releases # Needed by: # - php mbstring -ENV VERSION_ONIG=6.9.9 +ENV VERSION_ONIG=6.9.10 ENV ONIG_BUILD_DIR=${BUILD_DIR}/oniguruma RUN set -xe; \ mkdir -p ${ONIG_BUILD_DIR}; \ @@ -464,13 +465,15 @@ RUN set -xe; \ # Install extensions # We can install extensions manually or using `pecl` -RUN pecl install APCu +ENV VERSION_APCU=5.1.24 +RUN pecl install apcu-${VERSION_APCU} # --------------------------------------------------------------- # Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later) RUN mkdir -p /bref-layer/bin \ && mkdir -p /bref-layer/lib \ +&& mkdir -p /bref-layer/lib/ossl-modules \ && mkdir -p /bref-layer/bref/extensions \ && mkdir -p /bref-layer/bref/ssl @@ -498,6 +501,8 @@ RUN cp ${CA_BUNDLE} /bref-layer/bref/ssl/cert.pem # Copy the OpenSSL config RUN cp ${INSTALL_DIR}/bref/ssl/openssl.cnf /bref-layer/bref/ssl/openssl.cnf +# Copy the OpenSSL modules +RUN cp /tmp/build/openssl/providers/legacy.so /bref-layer/lib/ossl-modules/legacy.so # --------------------------------------------------------------- # Start from a clean image to copy only the files we need diff --git a/php-81/Dockerfile b/php-81/Dockerfile index 5405b473..7608ffda 100644 --- a/php-81/Dockerfile +++ b/php-81/Dockerfile @@ -4,7 +4,7 @@ ARG IMAGE_VERSION_SUFFIX # https://www.php.net/downloads -ARG VERSION_PHP=8.1.29 +ARG VERSION_PHP=8.1.32 # Lambda uses a custom AMI named Amazon Linux 2 @@ -104,7 +104,7 @@ RUN set -xe; \ # - curl # - php RUN yum install -y perl-IPC-Cmd -ENV VERSION_OPENSSL=3.3.1 +ENV VERSION_OPENSSL=3.3.3 ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem" @@ -121,6 +121,7 @@ RUN CFLAGS="" \ --openssldir=${INSTALL_DIR}/bref/ssl \ --release \ enable-tls1_3 \ + enable-legacy \ no-tests \ shared \ zlib @@ -141,7 +142,7 @@ RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOU # Needed by: # - php # - libnghttp2 -ENV VERSION_XML2=2.12.9 +ENV VERSION_XML2=2.12.10 ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 RUN set -xe; \ mkdir -p ${XML2_BUILD_DIR}; \ @@ -174,7 +175,7 @@ RUN make install \ # - OpenSSL # Needed by: # - curl -ENV VERSION_LIBSSH2=1.11.0 +ENV VERSION_LIBSSH2=1.11.1 ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 RUN set -xe; \ mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ @@ -207,7 +208,7 @@ RUN cmake --build . --target install # - libxml2 # Needed by: # - curl -ENV VERSION_NGHTTP2=1.62.1 +ENV VERSION_NGHTTP2=1.65.0 ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 RUN set -xe; \ mkdir -p ${NGHTTP2_BUILD_DIR}; \ @@ -254,7 +255,7 @@ RUN make -j $(nproc) && make install # # - libnghttp2 # # Needed by: # # - php -ENV VERSION_CURL=8.9.1 +ENV VERSION_CURL=8.12.1 ENV CURL_BUILD_DIR=${BUILD_DIR}/curl RUN set -xe; \ mkdir -p ${CURL_BUILD_DIR}/bin; \ @@ -294,7 +295,7 @@ RUN make install # https://github.com/nih-at/libzip/releases # Needed by: # - php -ENV VERSION_ZIP=1.10.1 +ENV VERSION_ZIP=1.11.3 ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip RUN set -xe; \ mkdir -p ${ZIP_BUILD_DIR}/bin/; \ @@ -337,7 +338,7 @@ RUN make install # - OpenSSL # Needed by: # - php -ENV VERSION_POSTGRES=16.3 +ENV VERSION_POSTGRES=17.4 ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres RUN set -xe; \ mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ @@ -363,7 +364,7 @@ RUN cd ${POSTGRES_BUILD_DIR}/src/include && make install # https://github.com/kkos/oniguruma/releases # Needed by: # - php mbstring -ENV VERSION_ONIG=6.9.9 +ENV VERSION_ONIG=6.9.10 ENV ONIG_BUILD_DIR=${BUILD_DIR}/oniguruma RUN set -xe; \ mkdir -p ${ONIG_BUILD_DIR}; \ @@ -374,14 +375,34 @@ RUN ./configure --prefix=${INSTALL_DIR} RUN make && make install +############################################################################### +# SQLite +# Since PHP 7.4, libsqlite must be installed (https://github.com/php/php-src/blob/99b8e67615159fc600a615e1e97f2d1cf18f14cb/UPGRADING#L616-L619) +# Laravel 11 requires SQLite 3.35.0 or higher and Drupal 10 also requires a +# newer version than the system version of 3.7.17. +# https://laravel.com/docs/11.x/upgrade#sqlite-minimum-version +# https://www.sqlite.org/changes.html +# Needed by: +# - php +RUN LD_LIBRARY_PATH= yum install -y tcl +ENV VERSION_SQLITE=3.49.1 +ENV SQLITE_BUILD_DIR=${BUILD_DIR}/sqlite +RUN set -xe; \ + mkdir -p ${SQLITE_BUILD_DIR}; \ + curl -Ls https://github.com/sqlite/sqlite/archive/refs/tags/version-${VERSION_SQLITE}.tar.gz \ + | tar xzC ${SQLITE_BUILD_DIR} --strip-components=1 +WORKDIR ${SQLITE_BUILD_DIR} +RUN ./configure --prefix=${INSTALL_DIR} +RUN make && make install + + ############################################################################### # Install some dev files for using old libraries already on the system # readline-devel : needed for the readline extension # gettext-devel : needed for the --with-gettext flag # libicu-devel : needed for intl # libxslt-devel : needed for the XSL extension -# sqlite-devel : Since PHP 7.4 this must be installed (https://github.com/php/php-src/blob/99b8e67615159fc600a615e1e97f2d1cf18f14cb/UPGRADING#L616-L619) -RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel sqlite-devel +RUN LD_LIBRARY_PATH= yum install -y readline-devel gettext-devel libicu-devel libxslt-devel # Note: this variable is used when building extra/custom extensions, do not remove @@ -465,13 +486,15 @@ RUN set -xe; \ # Install extensions # We can install extensions manually or using `pecl` -RUN pecl install APCu +ENV VERSION_APCU=5.1.24 +RUN pecl install apcu-${VERSION_APCU} # --------------------------------------------------------------- # Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later) RUN mkdir -p /bref-layer/bin \ && mkdir -p /bref-layer/lib \ +&& mkdir -p /bref-layer/lib/ossl-modules \ && mkdir -p /bref-layer/bref/extensions \ && mkdir -p /bref-layer/bref/ssl @@ -499,6 +522,8 @@ RUN cp ${CA_BUNDLE} /bref-layer/bref/ssl/cert.pem # Copy the OpenSSL config RUN cp ${INSTALL_DIR}/bref/ssl/openssl.cnf /bref-layer/bref/ssl/openssl.cnf +# Copy the OpenSSL modules +RUN cp /tmp/build/openssl/providers/legacy.so /bref-layer/lib/ossl-modules/legacy.so # --------------------------------------------------------------- # Start from a clean image to copy only the files we need diff --git a/php-82/Dockerfile b/php-82/Dockerfile index 00a3d5e1..330308f7 100644 --- a/php-82/Dockerfile +++ b/php-82/Dockerfile @@ -4,7 +4,7 @@ ARG IMAGE_VERSION_SUFFIX # https://www.php.net/downloads -ARG VERSION_PHP=8.2.22 +ARG VERSION_PHP=8.2.28 # Lambda uses a custom AMI named Amazon Linux 2 @@ -104,7 +104,7 @@ RUN set -xe; \ # - curl # - php RUN yum install -y perl-IPC-Cmd -ENV VERSION_OPENSSL=3.3.1 +ENV VERSION_OPENSSL=3.3.3 ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem" @@ -121,6 +121,7 @@ RUN CFLAGS="" \ --openssldir=${INSTALL_DIR}/bref/ssl \ --release \ enable-tls1_3 \ + enable-legacy \ no-tests \ shared \ zlib @@ -141,7 +142,7 @@ RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOU # Needed by: # - php # - libnghttp2 -ENV VERSION_XML2=2.13.3 +ENV VERSION_XML2=2.13.7 ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 RUN set -xe; \ mkdir -p ${XML2_BUILD_DIR}; \ @@ -174,7 +175,7 @@ RUN make install \ # - OpenSSL # Needed by: # - curl -ENV VERSION_LIBSSH2=1.11.0 +ENV VERSION_LIBSSH2=1.11.1 ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 RUN set -xe; \ mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ @@ -207,7 +208,7 @@ RUN cmake --build . --target install # - libxml2 # Needed by: # - curl -ENV VERSION_NGHTTP2=1.62.1 +ENV VERSION_NGHTTP2=1.65.0 ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 RUN set -xe; \ mkdir -p ${NGHTTP2_BUILD_DIR}; \ @@ -254,7 +255,7 @@ RUN make -j $(nproc) && make install # # - libnghttp2 # # Needed by: # # - php -ENV VERSION_CURL=8.9.1 +ENV VERSION_CURL=8.12.1 ENV CURL_BUILD_DIR=${BUILD_DIR}/curl RUN set -xe; \ mkdir -p ${CURL_BUILD_DIR}/bin; \ @@ -294,7 +295,7 @@ RUN make install # https://github.com/nih-at/libzip/releases # Needed by: # - php -ENV VERSION_ZIP=1.10.1 +ENV VERSION_ZIP=1.11.3 ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip RUN set -xe; \ mkdir -p ${ZIP_BUILD_DIR}/bin/; \ @@ -337,7 +338,7 @@ RUN make install # - OpenSSL # Needed by: # - php -ENV VERSION_POSTGRES=16.3 +ENV VERSION_POSTGRES=17.4 ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres RUN set -xe; \ mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ @@ -363,7 +364,7 @@ RUN cd ${POSTGRES_BUILD_DIR}/src/include && make install # https://github.com/kkos/oniguruma/releases # Needed by: # - php mbstring -ENV VERSION_ONIG=6.9.9 +ENV VERSION_ONIG=6.9.10 ENV ONIG_BUILD_DIR=${BUILD_DIR}/oniguruma RUN set -xe; \ mkdir -p ${ONIG_BUILD_DIR}; \ @@ -377,13 +378,14 @@ RUN make && make install ############################################################################### # SQLite # Since PHP 7.4, libsqlite must be installed (https://github.com/php/php-src/blob/99b8e67615159fc600a615e1e97f2d1cf18f14cb/UPGRADING#L616-L619) -# Laravel 11 requires SQLite 3.35.0 or higher. The system version is 3.7.17. +# Laravel 11 requires SQLite 3.35.0 or higher and Drupal 10 also requires a +# newer version than the system version of 3.7.17. # https://laravel.com/docs/11.x/upgrade#sqlite-minimum-version # https://www.sqlite.org/changes.html # Needed by: # - php RUN LD_LIBRARY_PATH= yum install -y tcl -ENV VERSION_SQLITE=3.46.0 +ENV VERSION_SQLITE=3.49.1 ENV SQLITE_BUILD_DIR=${BUILD_DIR}/sqlite RUN set -xe; \ mkdir -p ${SQLITE_BUILD_DIR}; \ @@ -484,13 +486,15 @@ RUN set -xe; \ # Install extensions # We can install extensions manually or using `pecl` -RUN pecl install APCu +ENV VERSION_APCU=5.1.24 +RUN pecl install apcu-${VERSION_APCU} # --------------------------------------------------------------- # Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later) RUN mkdir -p /bref-layer/bin \ && mkdir -p /bref-layer/lib \ +&& mkdir -p /bref-layer/lib/ossl-modules \ && mkdir -p /bref-layer/bref/extensions \ && mkdir -p /bref-layer/bref/ssl @@ -518,6 +522,8 @@ RUN cp ${CA_BUNDLE} /bref-layer/bref/ssl/cert.pem # Copy the OpenSSL config RUN cp ${INSTALL_DIR}/bref/ssl/openssl.cnf /bref-layer/bref/ssl/openssl.cnf +# Copy the OpenSSL modules +RUN cp /tmp/build/openssl/providers/legacy.so /bref-layer/lib/ossl-modules/legacy.so # --------------------------------------------------------------- # Start from a clean image to copy only the files we need diff --git a/php-83/Dockerfile b/php-83/Dockerfile index 7173612d..3b36a46b 100644 --- a/php-83/Dockerfile +++ b/php-83/Dockerfile @@ -4,7 +4,7 @@ ARG IMAGE_VERSION_SUFFIX # https://www.php.net/downloads -ARG VERSION_PHP=8.3.10 +ARG VERSION_PHP=8.3.20 # Lambda uses a custom AMI named Amazon Linux 2 @@ -104,7 +104,7 @@ RUN set -xe; \ # - curl # - php RUN yum install -y perl-IPC-Cmd -ENV VERSION_OPENSSL=3.3.1 +ENV VERSION_OPENSSL=3.3.3 ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem" @@ -121,6 +121,7 @@ RUN CFLAGS="" \ --openssldir=${INSTALL_DIR}/bref/ssl \ --release \ enable-tls1_3 \ + enable-legacy \ no-tests \ shared \ zlib @@ -141,7 +142,7 @@ RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOU # Needed by: # - php # - libnghttp2 -ENV VERSION_XML2=2.13.3 +ENV VERSION_XML2=2.13.7 ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 RUN set -xe; \ mkdir -p ${XML2_BUILD_DIR}; \ @@ -174,7 +175,7 @@ RUN make install \ # - OpenSSL # Needed by: # - curl -ENV VERSION_LIBSSH2=1.11.0 +ENV VERSION_LIBSSH2=1.11.1 ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 RUN set -xe; \ mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ @@ -207,7 +208,7 @@ RUN cmake --build . --target install # - libxml2 # Needed by: # - curl -ENV VERSION_NGHTTP2=1.62.1 +ENV VERSION_NGHTTP2=1.65.0 ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 RUN set -xe; \ mkdir -p ${NGHTTP2_BUILD_DIR}; \ @@ -254,7 +255,7 @@ RUN make -j $(nproc) && make install # # - libnghttp2 # # Needed by: # # - php -ENV VERSION_CURL=8.9.1 +ENV VERSION_CURL=8.12.1 ENV CURL_BUILD_DIR=${BUILD_DIR}/curl RUN set -xe; \ mkdir -p ${CURL_BUILD_DIR}/bin; \ @@ -294,7 +295,7 @@ RUN make install # https://github.com/nih-at/libzip/releases # Needed by: # - php -ENV VERSION_ZIP=1.10.1 +ENV VERSION_ZIP=1.11.3 ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip RUN set -xe; \ mkdir -p ${ZIP_BUILD_DIR}/bin/; \ @@ -337,7 +338,7 @@ RUN make install # - OpenSSL # Needed by: # - php -ENV VERSION_POSTGRES=16.3 +ENV VERSION_POSTGRES=17.4 ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres RUN set -xe; \ mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ @@ -363,7 +364,7 @@ RUN cd ${POSTGRES_BUILD_DIR}/src/include && make install # https://github.com/kkos/oniguruma/releases # Needed by: # - php mbstring -ENV VERSION_ONIG=6.9.9 +ENV VERSION_ONIG=6.9.10 ENV ONIG_BUILD_DIR=${BUILD_DIR}/oniguruma RUN set -xe; \ mkdir -p ${ONIG_BUILD_DIR}; \ @@ -377,13 +378,14 @@ RUN make && make install ############################################################################### # SQLite # Since PHP 7.4, libsqlite must be installed (https://github.com/php/php-src/blob/99b8e67615159fc600a615e1e97f2d1cf18f14cb/UPGRADING#L616-L619) -# Laravel 11 requires SQLite 3.35.0 or higher. The system version is 3.7.17. +# Laravel 11 requires SQLite 3.35.0 or higher and Drupal 10 also requires a +# newer version than the system version of 3.7.17. # https://laravel.com/docs/11.x/upgrade#sqlite-minimum-version # https://www.sqlite.org/changes.html # Needed by: # - php RUN LD_LIBRARY_PATH= yum install -y tcl -ENV VERSION_SQLITE=3.46.0 +ENV VERSION_SQLITE=3.49.1 ENV SQLITE_BUILD_DIR=${BUILD_DIR}/sqlite RUN set -xe; \ mkdir -p ${SQLITE_BUILD_DIR}; \ @@ -484,13 +486,15 @@ RUN set -xe; \ # Install extensions # We can install extensions manually or using `pecl` -RUN pecl install APCu +ENV VERSION_APCU=5.1.24 +RUN pecl install apcu-${VERSION_APCU} # --------------------------------------------------------------- # Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later) RUN mkdir -p /bref-layer/bin \ && mkdir -p /bref-layer/lib \ +&& mkdir -p /bref-layer/lib/ossl-modules \ && mkdir -p /bref-layer/bref/extensions \ && mkdir -p /bref-layer/bref/ssl @@ -518,6 +522,8 @@ RUN cp ${CA_BUNDLE} /bref-layer/bref/ssl/cert.pem # Copy the OpenSSL config RUN cp ${INSTALL_DIR}/bref/ssl/openssl.cnf /bref-layer/bref/ssl/openssl.cnf +# Copy the OpenSSL modules +RUN cp /tmp/build/openssl/providers/legacy.so /bref-layer/lib/ossl-modules/legacy.so # --------------------------------------------------------------- # Start from a clean image to copy only the files we need diff --git a/php-84/Dockerfile b/php-84/Dockerfile index 8aeafac4..5a5d2e42 100644 --- a/php-84/Dockerfile +++ b/php-84/Dockerfile @@ -4,8 +4,7 @@ ARG IMAGE_VERSION_SUFFIX # https://www.php.net/downloads -ARG RELEASE_USER_PHP=saki -ARG VERSION_PHP=8.4.0alpha4 +ARG VERSION_PHP=8.4.6 # Lambda uses a custom AMI named Amazon Linux 2 @@ -105,7 +104,7 @@ RUN set -xe; \ # - curl # - php RUN yum install -y perl-IPC-Cmd -ENV VERSION_OPENSSL=3.3.1 +ENV VERSION_OPENSSL=3.3.3 ENV OPENSSL_BUILD_DIR=${BUILD_DIR}/openssl ENV CA_BUNDLE_SOURCE="https://curl.se/ca/cacert.pem" ENV CA_BUNDLE="${INSTALL_DIR}/bref/ssl/cert.pem" @@ -122,6 +121,7 @@ RUN CFLAGS="" \ --openssldir=${INSTALL_DIR}/bref/ssl \ --release \ enable-tls1_3 \ + enable-legacy \ no-tests \ shared \ zlib @@ -142,7 +142,7 @@ RUN mkdir -p ${INSTALL_DIR}/bref/ssl && curl -Lk -o ${CA_BUNDLE} ${CA_BUNDLE_SOU # Needed by: # - php # - libnghttp2 -ENV VERSION_XML2=2.13.3 +ENV VERSION_XML2=2.13.7 ENV XML2_BUILD_DIR=${BUILD_DIR}/xml2 RUN set -xe; \ mkdir -p ${XML2_BUILD_DIR}; \ @@ -175,7 +175,7 @@ RUN make install \ # - OpenSSL # Needed by: # - curl -ENV VERSION_LIBSSH2=1.11.0 +ENV VERSION_LIBSSH2=1.11.1 ENV LIBSSH2_BUILD_DIR=${BUILD_DIR}/libssh2 RUN set -xe; \ mkdir -p ${LIBSSH2_BUILD_DIR}/bin; \ @@ -208,7 +208,7 @@ RUN cmake --build . --target install # - libxml2 # Needed by: # - curl -ENV VERSION_NGHTTP2=1.62.1 +ENV VERSION_NGHTTP2=1.65.0 ENV NGHTTP2_BUILD_DIR=${BUILD_DIR}/nghttp2 RUN set -xe; \ mkdir -p ${NGHTTP2_BUILD_DIR}; \ @@ -255,7 +255,7 @@ RUN make -j $(nproc) && make install # # - libnghttp2 # # Needed by: # # - php -ENV VERSION_CURL=8.9.1 +ENV VERSION_CURL=8.12.1 ENV CURL_BUILD_DIR=${BUILD_DIR}/curl RUN set -xe; \ mkdir -p ${CURL_BUILD_DIR}/bin; \ @@ -295,7 +295,7 @@ RUN make install # https://github.com/nih-at/libzip/releases # Needed by: # - php -ENV VERSION_ZIP=1.10.1 +ENV VERSION_ZIP=1.11.3 ENV ZIP_BUILD_DIR=${BUILD_DIR}/zip RUN set -xe; \ mkdir -p ${ZIP_BUILD_DIR}/bin/; \ @@ -338,7 +338,7 @@ RUN make install # - OpenSSL # Needed by: # - php -ENV VERSION_POSTGRES=16.3 +ENV VERSION_POSTGRES=17.4 ENV POSTGRES_BUILD_DIR=${BUILD_DIR}/postgres RUN set -xe; \ mkdir -p ${POSTGRES_BUILD_DIR}/bin; \ @@ -364,7 +364,7 @@ RUN cd ${POSTGRES_BUILD_DIR}/src/include && make install # https://github.com/kkos/oniguruma/releases # Needed by: # - php mbstring -ENV VERSION_ONIG=6.9.9 +ENV VERSION_ONIG=6.9.10 ENV ONIG_BUILD_DIR=${BUILD_DIR}/oniguruma RUN set -xe; \ mkdir -p ${ONIG_BUILD_DIR}; \ @@ -381,13 +381,14 @@ RUN make && make install # PHP 8.4 requires SQLite 3.13.0 or higher because the build uses the # `SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION` constant. # See https://github.com/brefphp/aws-lambda-layers/pull/185 -# Moreover, Laravel 11 requires SQLite 3.35.0 or higher. The system version is 3.7.17. +# Laravel 11 requires SQLite 3.35.0 or higher and Drupal 10 also requires a +# newer version than the system version of 3.7.17. # https://laravel.com/docs/11.x/upgrade#sqlite-minimum-version # https://www.sqlite.org/changes.html # Needed by: # - php RUN LD_LIBRARY_PATH= yum install -y tcl -ENV VERSION_SQLITE=3.46.0 +ENV VERSION_SQLITE=3.49.1 ENV SQLITE_BUILD_DIR=${BUILD_DIR}/sqlite RUN set -xe; \ mkdir -p ${SQLITE_BUILD_DIR}; \ @@ -425,9 +426,8 @@ WORKDIR ${PHP_BUILD_DIR} # --location will follow redirects # --silent will hide the progress, but also the errors: we restore error messages with --show-error # --fail makes sure that curl returns an error instead of fetching the 404 page -ARG RELEASE_USER_PHP ARG VERSION_PHP -RUN curl --location --silent --show-error --fail https://downloads.php.net/~${RELEASE_USER_PHP}/php-${VERSION_PHP}.tar.gz \ +RUN curl --location --silent --show-error --fail https://www.php.net/get/php-${VERSION_PHP}.tar.gz/from/this/mirror \ | tar xzC . --strip-components=1 # Configure the build @@ -487,13 +487,15 @@ RUN set -xe; \ # Install extensions # We can install extensions manually or using `pecl` -RUN pecl install APCu +ENV VERSION_APCU=5.1.24 +RUN pecl install apcu-${VERSION_APCU} # --------------------------------------------------------------- # Now we copy everything we need for the layers into /bref-layer (which will be used for the real /opt later) RUN mkdir -p /bref-layer/bin \ && mkdir -p /bref-layer/lib \ +&& mkdir -p /bref-layer/lib/ossl-modules \ && mkdir -p /bref-layer/bref/extensions \ && mkdir -p /bref-layer/bref/ssl @@ -521,6 +523,8 @@ RUN cp ${CA_BUNDLE} /bref-layer/bref/ssl/cert.pem # Copy the OpenSSL config RUN cp ${INSTALL_DIR}/bref/ssl/openssl.cnf /bref-layer/bref/ssl/openssl.cnf +# Copy the OpenSSL modules +RUN cp /tmp/build/openssl/providers/legacy.so /bref-layer/lib/ossl-modules/legacy.so # --------------------------------------------------------------- # Start from a clean image to copy only the files we need diff --git a/utils/lib-copy/copy-dependencies.php b/utils/lib-copy/copy-dependencies.php index 7094571e..8bfb92c6 100644 --- a/utils/lib-copy/copy-dependencies.php +++ b/utils/lib-copy/copy-dependencies.php @@ -36,7 +36,13 @@ $librariesThatExistOnLambda = array_map('trim', $librariesThatExistOnLambda); // For some reason some libraries are actually not in Lambda, despite being in the docker image 🤷 $librariesThatExistOnLambda = array_filter($librariesThatExistOnLambda, function ($library) { - return ! str_contains($library, 'libgcrypt.so') && ! str_contains($library, 'libgpg-error.so'); + return ! str_contains($library, 'libgcrypt.so') + && ! str_contains($library, 'libassuan.so') + && ! str_contains($library, 'libgobject-2.0.so') + && ! str_contains($library, 'libgpg-error.so') + && ! str_contains($library, 'libgpgme-pthread.so') + && ! str_contains($library, 'libgpgme.so') + ; }); $requiredLibraries = listDependencies($pathToCheck); diff --git a/utils/lib-copy/libs-arm.txt b/utils/lib-copy/libs-arm.txt index 6bc3cbd8..57032c49 100644 --- a/utils/lib-copy/libs-arm.txt +++ b/utils/lib-copy/libs-arm.txt @@ -29,7 +29,7 @@ libcrypto.so.1.0.2k libcrypt.so.1 libc.so.6 libcurl.so.4 -libcurl.so.4.7.0 +libcurl.so.4.8.0 libdb-5.3.so libdb-5.so libdl-2.26.so @@ -182,6 +182,8 @@ libpng15.so.15 libpng15.so.15.13.0 libpopt.so.0 libpopt.so.0.0.0 +libpsl.so.5 +libpsl.so.5.3.5 libpsx.so.2 libpsx.so.2.54 libpthread-2.26.so diff --git a/utils/lib-copy/libs-x86.txt b/utils/lib-copy/libs-x86.txt index a4cf64eb..6d44653a 100644 --- a/utils/lib-copy/libs-x86.txt +++ b/utils/lib-copy/libs-x86.txt @@ -29,7 +29,7 @@ libcrypto.so.1.0.2k libcrypt.so.1 libc.so.6 libcurl.so.4 -libcurl.so.4.7.0 +libcurl.so.4.8.0 libdb-5.3.so libdb-5.so libdl-2.26.so @@ -184,6 +184,8 @@ libpng15.so.15 libpng15.so.15.13.0 libpopt.so.0 libpopt.so.0.0.0 +libpsl.so.5 +libpsl.so.5.3.5 libpsx.so.2 libpsx.so.2.54 libpthread-2.26.so