php: PHP 8.0.15 failing to build sockets extension
I am trying to build the PHP sockets
extension with the php:8.0-fpm
tag. This tag updated to PHP 8.0.15 today and is failing with the output below. Using the php:8.0.14-fpm
works as expected
Checked the following tags and all fail with the same error
8.0.15-fpm-bullseye
8.0.15-fpm-buster
8.0.15-fpm-alpine3.15
8.0.15-fpm-alpine3.14
8.0.15-cli-bullseye
: not FPM, but wanted to confirm it also fails
$ docker run --rm --name fpmtest php:8.0.15-fpm docker-php-ext-install sockets
Configuring for:
PHP Api Version: 20200930
Zend Module Api No: 20200930
Zend Extension Api No: 420200930
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 pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
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 for system library directory... lib
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-20200930
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable sockets support... yes, shared
checking for hstrerror... yes
checking for if_nametoindex... yes
checking for if_indextoname... yes
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 netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for field ss_family in struct sockaddr_storage... yes
checking if getaddrinfo supports AI_V4MAPPED... yes
checking if getaddrinfo supports AI_ALL... yes
checking if getaddrinfo supports AI_IDN... no
checking if ancillary credentials uses ucred... no
checking if ancillary credentials uses cmsgcred... no
checking for a sed that does not truncate output... /bin/sed
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 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... yes
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: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
/bin/bash /usr/src/php/ext/sockets/libtool --mode=compile cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sockets.c -o sockets.lo
mkdir .libs
cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sockets.c -fPIC -DPIC -o .libs/sockets.o
/bin/bash /usr/src/php/ext/sockets/libtool --mode=compile cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/multicast.c -o multicast.lo
cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/multicast.c -fPIC -DPIC -o .libs/multicast.o
/bin/bash /usr/src/php/ext/sockets/libtool --mode=compile cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/conversions.c -o conversions.lo
cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/conversions.c -fPIC -DPIC -o .libs/conversions.o
/bin/bash /usr/src/php/ext/sockets/libtool --mode=compile cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sockaddr_conv.c -o sockaddr_conv.lo
cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sockaddr_conv.c -fPIC -DPIC -o .libs/sockaddr_conv.o
/bin/bash /usr/src/php/ext/sockets/libtool --mode=compile cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sendrecvmsg.c -o sendrecvmsg.lo
cc -I. -I/usr/src/php/ext/sockets -I/usr/src/php/ext/sockets/include -I/usr/src/php/ext/sockets/main -I/usr/src/php/ext/sockets -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 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sendrecvmsg.c -fPIC -DPIC -o .libs/sendrecvmsg.o
/usr/src/php/ext/sockets/sendrecvmsg.c: In function 'init_ancillary_registry':
/usr/src/php/ext/sockets/sendrecvmsg.c:128:19: error: invalid application of 'sizeof' to incomplete type 'struct cmsgcred'
128 | PUT_ENTRY(sizeof(struct cmsgcred), 0, 0, from_zval_write_ucred,
| ^~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:99:17: note: in definition of macro 'PUT_ENTRY'
99 | entry.size = sizev; \
| ^~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:129:36: error: 'SCM_CREDS' undeclared (first use in this function)
129 | to_zval_read_ucred, SOL_SOCKET, SCM_CREDS);
| ^~~~~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:105:19: note: in definition of macro 'PUT_ENTRY'
105 | key.cmsg_type = type; \
| ^~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:129:36: note: each undeclared identifier is reported only once for each function it appears in
129 | to_zval_read_ucred, SOL_SOCKET, SCM_CREDS);
| ^~~~~~~~~
/usr/src/php/ext/sockets/sendrecvmsg.c:105:19: note: in definition of macro 'PUT_ENTRY'
105 | key.cmsg_type = type; \
| ^~~~
make: *** [Makefile:216: sendrecvmsg.lo] Error 1
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 30
- Comments: 27 (5 by maintainers)
Commits related to this issue
- ext-sockets [WORKAROUND]: https://github.com/docker-library/php/issues/1245 — committed to koalaphils/docker-php by mdprotacio 2 years ago
- php 8.0.15 failing https://github.com/docker-library/php/issues/1245 — committed to artifakt-io/artifakt-docker-images by djalal 2 years ago
- php 8.0.15 failing compilation (#200) * php 8.0.15 failing https://github.com/docker-library/php/issues/1245 * Update Dockerfile — committed to artifakt-io/artifakt-docker-images by djalal 2 years ago
- PHP 8.0.15 and 8.1.2 has a bug - workaround Bug issue: https://github.com/php/php-src/issues/7978 Docker image issue: https://github.com/docker-library/php/issues/1245 — committed to jakubboucek/docker-lamp-devstack by jakubboucek 2 years ago
- PHP 8.0.15 and 8.1.2 has a bug - workaround Bug issue: php/php-src#7978 Docker image issue: docker-library/php#1245 — committed to jakubboucek/docker-lamp-devstack by jakubboucek 2 years ago
- PHP 8.0.15 and 8.1.2 has a bug - workaround Bug issue: php/php-src#7978 Docker image issue: docker-library/php#1245 — committed to jakubboucek/docker-lamp-devstack by jakubboucek 2 years ago
- Fixes "sockets" compilation issues https://github.com/docker-library/php/issues/1245#issuecomment-1019957169 — committed to elecena/python-php by macbre 2 years ago
- PHP 8.0.15 and 8.1.2 has a bug - workaround Bug issue: php/php-src#7978 Docker image issue: docker-library/php#1245 — committed to jakubboucek/docker-lamp-devstack by jakubboucek 2 years ago
- Add sockets extension The sockets extension is used by the current version of drupal/rabbitmq 3.x which is required by the social_real_time module on which the social_chat extension is built. E... — committed to goalgorilla/open_social_docker by Kingdutch 2 years ago
- [PHP] skip v8.0.15, https://github.com/docker-library/php/issues/1245 Signed-off-by: Kang Huaishuai <khs1994@khs1994.com> — committed to khs1994-docker/lnmp by khs1994 2 years ago
As a workaround you can put something like:
In your Dockerfile.
Unfortunately this issue is also present in the latest 8.1.2 builds. (For further information please see the mention above)
Confirmed this also fails for the newly released PHP 8.1.2
Another workaround is to set the CFLAGS variable just for the sockets install step in your Dockerfile:
RUN CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install sockets
This will produce another layer but uses the fix only for the socket install.
I’m sorry to hear, the following minimal example is running fine for me:
The official fixes for this are part of 8.0.16RC1 and 8.1.3RC1, one of which is in https://github.com/docker-library/official-images/pull/11805 already and the other of which will be there shortly (thanks to #1249). 👍
There was more discussion on this over in https://github.com/php/php-src/issues/7978 which has led to https://github.com/php/php-src/pull/7981 – I think it could probably benefit from some users testing it. 😄 👀
@tianon Will this fix be backported in
8.0
images ?https://github.com/docker-library/faq#an-images-source-changed-in-git-now-what 👀
Usually the build/push takes something like a few hours after the official images PR is merged, but depends heavily on the existing build queue.
Unfortunately this didn’t work for me (using 8.0.15-fpm-alpine3.15 as base image)
Looks like this is likely an upstream PHP bug in https://github.com/php/php-src/commit/51647eb23e61d214cdeb4167fcee1e2c38924bfe.
And the relevant configure lines where both
ANC_CREDS_UCRED
andANC_CREDS_CMSGCRED
are both undefined. It seems to be detectingucred
incorrectly?