I get this error when using docker-php-ext-install (on all extensions) with PHP-FPM 7.2.1 on Debian Stretch. It works on PHP-FPM 7.1.13
checking whether the C compiler works... no
configure: error: in `/usr/src/php/ext/iconv':
configure: error: C compiler cannot create executables
See `config.log' for more details
docker run -it php:7.2.1-fpm bash
root@2756ae5b0c19:/var/www/html# apt-get update && apt-get install -y \
> libfreetype6-dev \
> libjpeg62-turbo-dev \
> libmcrypt-dev \
> libpng-dev \
> && docker-php-ext-install -j$(nproc) iconv
Get:1 http://security.debian.org stretch/updates InRelease [63.0 kB]
Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:4 http://security.debian.org stretch/updates/main amd64 Packages [337 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [6499 B]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9531 kB]
Fetched 10.1 MB in 37s (268 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libfreetype6 libjpeg62-turbo libmcrypt4 libpng-tools libpng16-16 zlib1g-dev
Suggested packages:
mcrypt
The following NEW packages will be installed:
libfreetype6 libfreetype6-dev libjpeg62-turbo libjpeg62-turbo-dev libmcrypt-dev
libmcrypt4 libpng-dev libpng-tools libpng16-16 zlib1g-dev
0 upgraded, 10 newly installed, 0 to remove and 3 not upgraded.
Need to get 7628 kB of archives.
After this operation, 13.8 MB of additional disk space will be used.
Get:1 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libpng16-16 amd64 1.6.28-1 [280 kB]
Get:2 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libfreetype6 amd64 2.6.3-3.2 [438 kB]
Get:3 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 zlib1g-dev amd64 1:1.2.8.dfsg-5 [205 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libpng-dev amd64 1.6.28-1 [250 kB]
Get:5 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libfreetype6-dev amd64 2.6.3-3.2 [5815 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libjpeg62-turbo amd64 1:1.5.1-2 [134 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libjpeg62-turbo-dev amd64 1:1.5.1-2 [210 kB]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libmcrypt4 amd64 2.5.8-3.3 [71.2 kB]
Get:9 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libmcrypt-dev amd64 2.5.8-3.3 [92.9 kB]
Get:10 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libpng-tools amd64 1.6.28-1 [133 kB]
Fetched 7628 kB in 33s (231 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpng16-16:amd64.
(Reading database ... 12264 files and directories currently installed.)
Preparing to unpack .../0-libpng16-16_1.6.28-1_amd64.deb ...
Unpacking libpng16-16:amd64 (1.6.28-1) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../1-libfreetype6_2.6.3-3.2_amd64.deb ...
Unpacking libfreetype6:amd64 (2.6.3-3.2) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../2-zlib1g-dev_1%3a1.2.8.dfsg-5_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-5) ...
Selecting previously unselected package libpng-dev:amd64.
Preparing to unpack .../3-libpng-dev_1.6.28-1_amd64.deb ...
Unpacking libpng-dev:amd64 (1.6.28-1) ...
Selecting previously unselected package libfreetype6-dev.
Preparing to unpack .../4-libfreetype6-dev_2.6.3-3.2_amd64.deb ...
Unpacking libfreetype6-dev (2.6.3-3.2) ...
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack .../5-libjpeg62-turbo_1%3a1.5.1-2_amd64.deb ...
Unpacking libjpeg62-turbo:amd64 (1:1.5.1-2) ...
Selecting previously unselected package libjpeg62-turbo-dev:amd64.
Preparing to unpack .../6-libjpeg62-turbo-dev_1%3a1.5.1-2_amd64.deb ...
Unpacking libjpeg62-turbo-dev:amd64 (1:1.5.1-2) ...
Selecting previously unselected package libmcrypt4.
Preparing to unpack .../7-libmcrypt4_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt4 (2.5.8-3.3) ...
Selecting previously unselected package libmcrypt-dev.
Preparing to unpack .../8-libmcrypt-dev_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt-dev (2.5.8-3.3) ...
Selecting previously unselected package libpng-tools.
Preparing to unpack .../9-libpng-tools_1.6.28-1_amd64.deb ...
Unpacking libpng-tools (1.6.28-1) ...
Setting up libjpeg62-turbo:amd64 (1:1.5.1-2) ...
Setting up libpng16-16:amd64 (1.6.28-1) ...
Setting up libpng-tools (1.6.28-1) ...
Setting up libfreetype6:amd64 (2.6.3-3.2) ...
Processing triggers for libc-bin (2.24-11+deb9u1) ...
Setting up libjpeg62-turbo-dev:amd64 (1:1.5.1-2) ...
Setting up libmcrypt4 (2.5.8-3.3) ...
Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-5) ...
Setting up libmcrypt-dev (2.5.8-3.3) ...
Setting up libpng-dev:amd64 (1.6.28-1) ...
Setting up libfreetype6-dev (2.6.3-3.2) ...
Configuring for:
PHP Api Version: 20170718
Zend Module Api No: 20170718
Zend Extension Api No: 320170718
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... no
configure: error: in `/usr/src/php/ext/iconv':
configure: error: C compiler cannot create executables
See `config.log' for more details
docker run -it php:7.1.13-fpm bash
root@3275a5564f2c:/var/www/html# apt-get update && apt-get install -y \
> libfreetype6-dev \
> libjpeg62-turbo-dev \
> libmcrypt-dev \
> libpng-dev \
> && docker-php-ext-install -j$(nproc) iconv
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Ign http://deb.debian.org jessie InRelease
Get:2 http://deb.debian.org jessie-updates InRelease [145 kB]
Get:3 http://deb.debian.org jessie Release.gpg [2434 B]
Get:4 http://deb.debian.org jessie Release [148 kB]
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [607 kB]
Get:6 http://deb.debian.org jessie-updates/main amd64 Packages [23.1 kB]
Get:7 http://deb.debian.org jessie/main amd64 Packages [9064 kB]
Fetched 10.1 MB in 29s (335 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libpng12-dev' instead of 'libpng-dev'
The following extra packages will be installed:
libfreetype6 libjpeg62-turbo libmcrypt4 libpng12-0 zlib1g-dev
Suggested packages:
mcrypt
The following NEW packages will be installed:
libfreetype6 libfreetype6-dev libjpeg62-turbo libjpeg62-turbo-dev libmcrypt-dev libmcrypt4
libpng12-0 libpng12-dev zlib1g-dev
0 upgraded, 9 newly installed, 0 to remove and 3 not upgraded.
Need to get 2466 kB of archives.
After this operation, 9622 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian/ jessie/main libpng12-0 amd64 1.2.50-2+deb8u3 [173 kB]
Get:2 http://deb.debian.org/debian/ jessie/main libfreetype6 amd64 2.5.2-3+deb8u2 [466 kB]
Get:3 http://deb.debian.org/debian/ jessie/main zlib1g-dev amd64 1:1.2.8.dfsg-2+b1 [206 kB]
Get:4 http://deb.debian.org/debian/ jessie/main libpng12-dev amd64 1.2.50-2+deb8u3 [248 kB]
Get:5 http://deb.debian.org/debian/ jessie/main libfreetype6-dev amd64 2.5.2-3+deb8u2 [638 kB]
Get:6 http://deb.debian.org/debian/ jessie/main libjpeg62-turbo amd64 1:1.3.1-12 [116 kB]
Get:7 http://deb.debian.org/debian/ jessie/main libjpeg62-turbo-dev amd64 1:1.3.1-12 [455 kB]
Get:8 http://deb.debian.org/debian/ jessie/main libmcrypt4 amd64 2.5.8-3.3 [71.2 kB]
Get:9 http://deb.debian.org/debian/ jessie/main libmcrypt-dev amd64 2.5.8-3.3 [92.9 kB]
Fetched 2466 kB in 8s (278 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libpng12-0:amd64.
(Reading database ... 12703 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.50-2+deb8u3_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.50-2+deb8u3) ...
Selecting previously unselected package libfreetype6:amd64.
Preparing to unpack .../libfreetype6_2.5.2-3+deb8u2_amd64.deb ...
Unpacking libfreetype6:amd64 (2.5.2-3+deb8u2) ...
Selecting previously unselected package zlib1g-dev:amd64.
Preparing to unpack .../zlib1g-dev_1%3a1.2.8.dfsg-2+b1_amd64.deb ...
Unpacking zlib1g-dev:amd64 (1:1.2.8.dfsg-2+b1) ...
Selecting previously unselected package libpng12-dev:amd64.
Preparing to unpack .../libpng12-dev_1.2.50-2+deb8u3_amd64.deb ...
Unpacking libpng12-dev:amd64 (1.2.50-2+deb8u3) ...
Selecting previously unselected package libfreetype6-dev.
Preparing to unpack .../libfreetype6-dev_2.5.2-3+deb8u2_amd64.deb ...
Unpacking libfreetype6-dev (2.5.2-3+deb8u2) ...
Selecting previously unselected package libjpeg62-turbo:amd64.
Preparing to unpack .../libjpeg62-turbo_1%3a1.3.1-12_amd64.deb ...
Unpacking libjpeg62-turbo:amd64 (1:1.3.1-12) ...
Selecting previously unselected package libjpeg62-turbo-dev:amd64.
Preparing to unpack .../libjpeg62-turbo-dev_1%3a1.3.1-12_amd64.deb ...
Unpacking libjpeg62-turbo-dev:amd64 (1:1.3.1-12) ...
Selecting previously unselected package libmcrypt4.
Preparing to unpack .../libmcrypt4_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt4 (2.5.8-3.3) ...
Selecting previously unselected package libmcrypt-dev.
Preparing to unpack .../libmcrypt-dev_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt-dev (2.5.8-3.3) ...
Setting up libpng12-0:amd64 (1.2.50-2+deb8u3) ...
Setting up libfreetype6:amd64 (2.5.2-3+deb8u2) ...
Setting up zlib1g-dev:amd64 (1:1.2.8.dfsg-2+b1) ...
Setting up libpng12-dev:amd64 (1.2.50-2+deb8u3) ...
Setting up libfreetype6-dev (2.5.2-3+deb8u2) ...
Setting up libjpeg62-turbo:amd64 (1:1.3.1-12) ...
Setting up libjpeg62-turbo-dev:amd64 (1:1.3.1-12) ...
Setting up libmcrypt4 (2.5.8-3.3) ...
Setting up libmcrypt-dev (2.5.8-3.3) ...
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Configuring for:
PHP Api Version: 20160303
Zend Module Api No: 20160303
Zend Extension Api No: 320160303
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking for iconv support... yes, shared
checking for iconv... yes
checking if iconv is glibc's... yes
checking if iconv supports errno... yes
checking if iconv supports //IGNORE... no
checking if your cpp allows macro usage in include lines... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
/bin/bash /usr/src/php/ext/iconv/libtool --mode=compile cc -I"/usr/include" -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/src/php/ext/iconv -DPHP_ATOM_INC -I/usr/src/php/ext/iconv/include -I/usr/src/php/ext/iconv/main -I/usr/src/php/ext/iconv -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -DHAVE_CONFIG_H -I/usr/include -fstack-protector-strong -fpic -fpie -O2 -c /usr/src/php/ext/iconv/iconv.c -o iconv.lo
mkdir .libs
cc -I/usr/include -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/usr/src/php/ext/iconv -DPHP_ATOM_INC -I/usr/src/php/ext/iconv/include -I/usr/src/php/ext/iconv/main -I/usr/src/php/ext/iconv -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -DHAVE_CONFIG_H -I/usr/include -fstack-protector-strong -fpic -fpie -O2 -c /usr/src/php/ext/iconv/iconv.c -fPIC -DPIC -o .libs/iconv.o
/bin/bash /usr/src/php/ext/iconv/libtool --mode=link cc -DPHP_ATOM_INC -I/usr/src/php/ext/iconv/include -I/usr/src/php/ext/iconv/main -I/usr/src/php/ext/iconv -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -fstack-protector-strong -fpic -fpie -O2 -DHAVE_CONFIG_H -I/usr/include -fstack-protector-strong -fpic -fpie -O2 -L/usr/lib -Wl,-O1 -Wl,--hash-style=both -pie -o iconv.la -export-dynamic -avoid-version -prefer-pic -module -rpath /usr/src/php/ext/iconv/modules iconv.lo
cc -shared .libs/iconv.o -L/usr/lib -Wl,-O1 -Wl,--hash-style=both -Wl,-soname -Wl,iconv.so -o .libs/iconv.so
creating iconv.la
(cd .libs && rm -f iconv.la && ln -s ../iconv.la iconv.la)
/bin/bash /usr/src/php/ext/iconv/libtool --mode=install cp ./iconv.la /usr/src/php/ext/iconv/modules
cp ./.libs/iconv.so /usr/src/php/ext/iconv/modules/iconv.so
cp ./.libs/iconv.lai /usr/src/php/ext/iconv/modules/iconv.la
PATH="$PATH:/sbin" ldconfig -n /usr/src/php/ext/iconv/modules
----------------------------------------------------------------------
Libraries have been installed in:
/usr/src/php/ext/iconv/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20160303/
Installing header files: /usr/local/include/php/
warning: iconv (iconv.so) is already loaded!
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la modules/* libs/*
I get this error when using docker-php-ext-install (on all extensions) with PHP-FPM 7.2.1 on Debian Stretch. It works on PHP-FPM 7.1.13
PHP-FPM 7.2.1
PHP-FPM 7.1.13