Skip to content

Commit b2d0afc

Browse files
committed
Enable FFI extension
1 parent c1e9d72 commit b2d0afc

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

php-80/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN set -xe \
1818
# Download yum repository data to cache
1919
&& yum makecache \
2020
# Install default development tools (gcc, make, etc)
21-
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default
21+
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default \
22+
&& yum install -y libffi libffi-devel
2223

2324

2425
# The default version of cmake is 2.8.12. We need cmake to build a few of
@@ -449,6 +450,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
449450
--enable-intl=shared \
450451
--enable-soap \
451452
--with-xsl=${INSTALL_DIR} \
453+
--with-ffi \
452454
# necessary for `pecl` to work (to install PHP extensions)
453455
--with-pear \
454456
# extra compilation flags

php-81/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN set -xe \
1818
# Download yum repository data to cache
1919
&& yum makecache \
2020
# Install default development tools (gcc, make, etc)
21-
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default
21+
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default \
22+
&& yum install -y libffi libffi-devel
2223

2324

2425
# The default version of cmake is 2.8.12. We need cmake to build a few of
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-82/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN set -xe \
1818
# Download yum repository data to cache
1919
&& yum makecache \
2020
# Install default development tools (gcc, make, etc)
21-
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default
21+
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default \
22+
&& yum install -y libffi libffi-devel
2223

2324

2425
# The default version of cmake is 2.8.12. We need cmake to build a few of
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-83/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN set -xe \
1818
# Download yum repository data to cache
1919
&& yum makecache \
2020
# Install default development tools (gcc, make, etc)
21-
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default
21+
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default \
22+
&& yum install -y libffi libffi-devel
2223

2324

2425
# The default version of cmake is 2.8.12. We need cmake to build a few of
@@ -470,6 +471,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
470471
--enable-intl=shared \
471472
--enable-soap \
472473
--with-xsl=${INSTALL_DIR} \
474+
--with-ffi \
473475
# necessary for `pecl` to work (to install PHP extensions)
474476
--with-pear \
475477
# extra compilation flags

php-84/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ RUN set -xe \
1818
# Download yum repository data to cache
1919
&& yum makecache \
2020
# Install default development tools (gcc, make, etc)
21-
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default
21+
&& yum groupinstall -y "Development Tools" --setopt=group_package_types=mandatory,default \
22+
&& yum install -y libffi libffi-devel
2223

2324

2425
# The default version of cmake is 2.8.12. We need cmake to build a few of
@@ -471,6 +472,7 @@ RUN CFLAGS="-fstack-protector-strong -fpic -fpie -O3 -I${INSTALL_DIR}/include -I
471472
--enable-intl=shared \
472473
--enable-soap \
473474
--with-xsl=${INSTALL_DIR} \
475+
--with-ffi \
474476
# necessary for `pecl` to work (to install PHP extensions)
475477
--with-pear \
476478
# extra compilation flags

tests/test_2_extensions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'readline' => READLINE_LIB === 'readline',
6565
'reflection' => class_exists(\ReflectionClass::class),
6666
'session' => session_status() === PHP_SESSION_NONE,
67+
'ffi' => class_exists(\FFI::class),
6768
'zip' => class_exists(\ZipArchive::class),
6869
'zlib' => md5(gzcompress('abcde')) === 'db245560922b42f1935e73e20b30980e',
6970
];
@@ -94,11 +95,11 @@
9495
if ($private_key === false) {
9596
return false;
9697
}
97-
98+
9899
$public_key_pem = openssl_pkey_get_details($private_key)['key'];
99100
$details = openssl_pkey_get_details(openssl_pkey_get_public($public_key_pem));
100101
return $details['bits'] === 2048;
101-
})(),
102+
})(),
102103
'json' => function_exists('json_encode'),
103104
'bcmath' => function_exists('bcadd'),
104105
'ctype' => function_exists('ctype_digit'),

0 commit comments

Comments
 (0)