skip to Main Content

Installing the readline extension on php:7.3-fpm-alpine fails for these Alpine version:

  • php:7.3-fpm-alpine3.14 / php:7.3-fpm-alpine
  • php:7.3-fpm-alpine3.13

This is the minimum Dockerfile:

FROM php:7.3-fpm-alpine

RUN apk add --update --no-cache libedit-dev
RUN docker-php-ext-install -j$(nproc) readline

This is the error:

#6 13.76
#6 13.76 creating libtool
#6 13.79 appending configuration tag "CXX" to libtool
#6 13.85 configure: creating ./config.status
#6 13.89 config.status: creating config.h
#6 13.92 /bin/sh /usr/src/php/ext/readline/libtool --mode=compile cc  -I. -I/usr/src/php/ext/readline -DPHP_ATOM_INC -I/usr/src/php/ext/readline/include -I/usr/src/php/ext/readline/main -I/usr/src/php/ext/readline -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   -c /usr/src/php/ext/readline/readline.c -o readline.lo
#6 13.92 /bin/sh /usr/src/php/ext/readline/libtool --mode=compile cc  -I. -I/usr/src/php/ext/readline -DPHP_ATOM_INC -I/usr/src/php/ext/readline/include -I/usr/src/php/ext/readline/main -I/usr/src/php/ext/readline -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   -c /usr/src/php/ext/readline/readline_cli.c -o readline_cli.lo
#6 13.96 mkdir .libs
#6 13.97  cc -I. -I/usr/src/php/ext/readline -DPHP_ATOM_INC -I/usr/src/php/ext/readline/include -I/usr/src/php/ext/readline/main -I/usr/src/php/ext/readline -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 -c /usr/src/php/ext/readline/readline.c  -fPIC -DPIC -o .libs/readline.o
#6 13.97  cc -I. -I/usr/src/php/ext/readline -DPHP_ATOM_INC -I/usr/src/php/ext/readline/include -I/usr/src/php/ext/readline/main -I/usr/src/php/ext/readline -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 -c /usr/src/php/ext/readline/readline_cli.c  -fPIC -DPIC -o .libs/readline_cli.o
#6 14.11 In file included from /usr/local/include/php/main/php.h:37,
#6 14.11                  from /usr/src/php/ext/readline/readline.c:25:
#6 14.11 /usr/src/php/ext/readline/readline.c: In function 'zif_readline_info':
#6 14.11 /usr/src/php/ext/readline/readline.c:258:38: error: 'rl_mark' undeclared (first use in this function)
#6 14.11   258 |   add_assoc_long(return_value,"mark",rl_mark);
#6 14.11       |                                      ^~~~~~~
#6 14.11 /usr/local/include/php/Zend/zend_API.h:398:90: note: in definition of macro 'add_assoc_long'
#6 14.11   398 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
#6 14.11       |                                                                                          ^~~
#6 14.11 /usr/src/php/ext/readline/readline.c:258:38: note: each undeclared identifier is reported only once for each function it appears in
#6 14.11   258 |   add_assoc_long(return_value,"mark",rl_mark);
#6 14.11       |                                      ^~~~~~~
#6 14.11 /usr/local/include/php/Zend/zend_API.h:398:90: note: in definition of macro 'add_assoc_long'
#6 14.11   398 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
#6 14.11       |                                                                                          ^~~
#6 14.12 /usr/src/php/ext/readline/readline.c:260:47: error: 'rl_pending_input' undeclared (first use in this function)
#6 14.12   260 |   add_assoc_long(return_value,"pending_input",rl_pending_input);
#6 14.12       |                                               ^~~~~~~~~~~~~~~~
#6 14.12 /usr/local/include/php/Zend/zend_API.h:398:90: note: in definition of macro 'add_assoc_long'
#6 14.12   398 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
#6 14.12       |                                                                                          ^~~
#6 14.12 /usr/src/php/ext/readline/readline.c:267:60: error: 'rl_completion_suppress_append' undeclared (first use in this function)
#6 14.12   267 |   add_assoc_bool(return_value,"completion_suppress_append",rl_completion_suppress_append);
#6 14.12       |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#6 14.12 /usr/local/include/php/Zend/zend_API.h:400:90: note: in definition of macro 'add_assoc_bool'
#6 14.12   400 | #define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key), __b)
#6 14.12       |                                                                                          ^~~
#6 14.14 make: *** [Makefile:194: readline.lo] Error 1
#6 14.14 make: *** Waiting for unfinished jobs....
------
executor failed running [/bin/sh -c docker-php-ext-install -j$(nproc) readline]: exit code: 2

Official issue: https://github.com/docker-library/php/issues/1207

Does somebody has a solution?

Kind regards

Stefaan

2

Answers


  1. Chosen as BEST ANSWER

    Readline is a default extension

    $ docker run --rm php:7.3-fpm-alpine php -i | grep readline
    Configure Command =>  './configure'  '--build=x86_64-linux-musl' '--with-config-file-path=/usr/local/etc/php' '--with-config-file-scan-dir=/usr/local/etc/php/conf.d' '--enable-option-checking=fatal' '--with-mhash' '--with-pic' '--enable-ftp' '--enable-mbstring' '--enable-mysqlnd' '--with-password-argon2' '--with-sodium=shared' '--with-pdo-sqlite=/usr' '--with-sqlite3=/usr' '--with-curl' '--with-openssl' '--with-readline' '--with-zlib' '--enable-fpm' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--disable-cgi' 'build_alias=x86_64-linux-musl'
    readline
    

  2. In case readline is a standard extension in your pulled php image, just remove it in this Dockerfile

    FROM php:7.3-fpm-alpine
    
    RUN apk add --update --no-cache libedit-dev
    RUN docker-php-ext-install -j$(nproc)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search