Php: Trying to install PHP extensions with docker-php-ext-install but container plugin is missing or corrupt

Created on 7 Feb 2018  路  3Comments  路  Source: docker-library/php

I'm attempting to reconfigure PHP-GD to use FreeType using on the PHP 7.0 FPM container:

apt-get install -yq \
        libfreetype6-dev \
        libmcrypt-dev \
        libpng12-dev \
        libjpeg-dev \
        libpng-dev

docker-php-ext-configure gd \
        --enable-gd-native-ttf \
        --with-freetype-dir=/usr/include/freetype2 \
        --with-png-dir=/usr/include \
        --with-jpeg-dir=/usr/include

docker-php-ext-install gd

docker-php-ext-enable gd

However, I am getting the following error:

Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012
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/gd':
configure: error: C compiler cannot create executables
See `config.log' for more details

In my config.log I see:

Using built-in specs.
COLLECT_GCC=cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10) 
configure:2710: $? = 0
configure:2699: cc -V >&5
cc: error: unrecognized command line option '-V'
cc: fatal error: no input files
compilation terminated.
configure:2710: $? = 4
configure:2699: cc -qversion >&5
cc: error: unrecognized command line option '-qversion'
cc: fatal error: no input files
compilation terminated.
configure:2710: $? = 4
configure:2730: checking whether the C compiler works
configure:2752: cc -fstack-protector-strong -fpic -fpie -O2 -fstack-protector-strong -fpic -fpie -O2 -Wl,-O1 -Wl,--hash-style=both -pie conftest.c  >&5
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so: error loading plugin: /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so: invalid ELF header
collect2: error: ld returned 1 exit status
configure:2756: $? = 1
configure:2794: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2799: error: in `/usr/src/php/ext/gd':
configure:2801: error: C compiler cannot create executables
See `config.log' for more details

When I cat /usr/lib/gcc/x86_64-linux-gnu/4.9/liblto_plugin.so the content is empty. I have tried reinstalling GCC to see if it would replace this plugin file but it does not appear to help.

All 3 comments

Thanks, @yosifkit. I will try exchanging Docker for Mac Edge with Stable.

(Closing, since this issue appears to be environmental, not an issue we could fix in the image. :+1:)

Was this page helpful?
0 / 5 - 0 ratings