Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

76
Views
Error installing sockets php extension inside docker

Inside dockerfile:

docker-php-ext-install sockets

Gives these errors, on docker build (I used same dockerfile for days but today it appears this new error):

/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:213: sendrecvmsg.lo] Error 1
make: *** Waiting for unfinished jobs....
over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Adding to the answer posted by @user8998926

You can find several workarounds in the docker-library issue posted here: https://github.com/docker-library/php/issues/1245

The easiest being

CFLAGS="$CFLAGS -D_GNU_SOURCE" docker-php-ext-install sockets
over 4 years ago · Santiago Trujillo Report

0

It's a bug in docker images php:8.0.15 and php:8.1.2 for alpine & bullseye.

The fix is pending merge, in my case i've stick with a previous version in order to build.

It's being tracked here: https://github.com/php/php-src/issues/7978

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!