iliaal / php_excel

PHP Extension interface to the Excel writing/reading library
http://ilia.ws
533 stars 131 forks source link

Can't compile against PHP 8.1 and libxl 4.0.4.0 #281

Closed rltas closed 1 year ago

rltas commented 1 year ago

I'm trying to compile php_excel in an alpine based php image like this:

ARG PHP_VERSION

FROM php:${PHP_VERSION}-cli-alpine

RUN apk update && \
    apk --no-cache add \
      git \
      autoconf \
      gawk \
      g++ \
      libxml2-dev \
      make

WORKDIR /usr/src/

RUN git clone https://github.com/iliaal/php_excel

WORKDIR /usr/src/php_excel/

RUN wget https://www.libxl.com/download/libxl-lin-4.0.4.tar.gz && \
    tar xf libxl-lin-4.0.4.tar.gz && \
    ln -s libxl-4.0.4.0 libxl

RUN phpize

RUN awk -i inplace '{gsub(/ac_cv_lib_xl_xlCreateBookCA=no/, "ac_cv_lib_xl_xlCreateBookCA=yes");}1' configure

RUN ./configure \
    --with-php-config=/usr/local/bin/php-config \
    --with-excel \
    --with-libxl-incdir=libxl/include_c/ \
    --with-libxl-libdir=libxl/lib64/ \
    --with-libxml-dir=/usr/include/libxml2/

RUN make
export DOCKER_BUILDKIT=1
docker build -f Dockerfile \
  --no-cache --pull \
  --build-arg PHP_VERSION=8.1 \
  -t rltas/php:8.1-test-build-php_excel .

This way I'm getting past the xlCreateBookCA configure issue, but then it fails with... a lot of output, see https://pastebin.com/gXLwBnKr

Did anyone solve that with the most recent libxl and php version?

dmaicher commented 1 year ago

For me this works: https://github.com/iliaal/php_excel/issues/264#issuecomment-734449320

rltas commented 1 year ago

Eh, interesting. Counterintuitive but indeed it compiled, thanks will test the result.