Skip to content
Merged
Show file tree
Hide file tree
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
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,16 @@ RUN set -xe; \
libcurl4-openssl-dev \
# ffi
libffi-dev \
# gd (fonts)
libfreetype-dev \
# intl
libicu-dev \
# gd (JPEG)
libjpeg-dev \
# mbstring (regular expressions)
libonig-dev \
# gd (PNG)
libpng-dev \
# pdo_pgsql
libpq-dev \
# readline (interactive shell `php -a`)
Expand All @@ -61,6 +67,8 @@ RUN set -xe; \
libsqlite3-dev \
# openssl
libssl-dev \
# gd (WebP)
libwebp-dev \
# dom, simplexml, soap, xml, xmlreader, xmlwriter
libxml2-dev \
# xsl
Expand Down Expand Up @@ -135,6 +143,10 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O2 -ffunction-sections -fdata-
--with-sqlite3 \
--with-pdo-sqlite \
# Separate .so extensions so that they are not loaded by default
--enable-gd=shared \
--with-freetype \
--with-jpeg \
--with-webp \
--enable-intl=shared \
--enable-soap=shared \
# Needed by `pecl` to install extensions (in this image and in images built on it)
Expand Down Expand Up @@ -190,10 +202,16 @@ RUN set -xe; \
libcurl4t64 \
# ffi
libffi8 \
# gd (fonts)
libfreetype6 \
# intl
libicu78 \
# gd (JPEG)
libjpeg-turbo8 \
# mbstring (regular expressions)
libonig5 \
# gd (PNG)
libpng16-16t64 \
# pdo_pgsql
libpq5 \
# readline (interactive shell `php -a`)
Expand All @@ -204,6 +222,11 @@ RUN set -xe; \
libsqlite3-0 \
# openssl
libssl3t64 \
# gd (WebP)
libwebp7 \
# gd (animated WebP, PHP 8.6+)
libwebpdemux2 \
libwebpmux3 \
# dom, simplexml, soap, xml, xmlreader, xmlwriter
libxml2-16 \
# xsl
Expand Down
1 change: 1 addition & 0 deletions tests/test_2_extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
}

$extensionsDisabledByDefault = [
'gd' => function_exists('gd_info'),
'intl' => class_exists(\Collator::class),
'apcu' => function_exists('apcu_add'),
'soap' => class_exists(\SoapClient::class),
Expand Down
10 changes: 10 additions & 0 deletions tests/test_3_manual_enabling_extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require_once __DIR__ . '/utils.php';

$extensions = [
'gd' => function_exists('gd_info'),
'intl' => class_exists(\Collator::class),
'apcu' => function_exists('apcu_add'),
'soap' => class_exists(\SoapClient::class),
Expand All @@ -22,3 +23,12 @@
}
success("[Extension] $extension");
}

// gd must support the common image formats and fonts
$gdInfo = gd_info();
foreach (['JPEG Support', 'PNG Support', 'WebP Support', 'FreeType Support'] as $feature) {
if (empty($gdInfo[$feature])) {
error("gd was compiled without $feature");
}
success("[Extension] gd: $feature");
}
1 change: 1 addition & 0 deletions tests/test_3_manual_extensions.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
extension=gd
extension=intl
extension=apcu
extension=soap
Expand Down