Closed do-io closed 3 years ago
Try setting LIBS: https://github.com/iliaal/php_excel/issues/21#issuecomment-3218478
I ran into the same error with libxl-3.9.4.3. Setting LIBS did not work. Compilation worked fine with libxl-3.8.4.0 You can still download that version: https://www.libxl.com/download/libxl-lin-3.8.4.tar.gz
Somehow the check for xlCreateBookCA fails with the newest version. There is no mention of changes in the changelog.txt.
You can trick the compilation to go all the way with libxl-3.9.4.3 by changing
ac_cv_lib_xl_xlCreateBookCA=no
into
ac_cv_lib_xl_xlCreateBookCA=yes
in the generated configure
When I tried to load the excel.so with libxl-3.9.4.3 on my old CentOS 6 system, I got this error:
version
GLIBC_2.14' not found (required by /usr/local/src/libxl-3.9.4.3/lib64/libxl.so`
That might also be the cause of the failing test for xlCreateBookCA!
I am running Glibc 2.12 on the CentOS 6 system:
# ldd --version
ldd (GNU libc) 2.12
@do-io What is your version?
Building and loading with this ftp://xlware.com/build/libxl-lin-3.9.0.5.tar.gz (found at ftp://xlware.com/build ) worked fine. Maybe there are newer 3.9.x versions that also work, but at least this one did.
https://www.libxl.com/download/libxl-lin-3.9.3.0.tar.gz still works. https://www.libxl.com/download/libxl-lin-3.9.4.2.tar.gz does not. https://www.libxl.com/download/libxl-lin-3.9.4.3.tar.gz does not.
Apparently the 3.9.4.x versions were compiled on a platform with a Glibc > 2.12
@Jan-E it looks like the php8 alpine docker image I am installing installed with glib (2.66.8-r0)
. Going to flip to another PHP image to see what we had with the regular apache debian image
Are we talking about the same? Glibc is at version 2.33 at the moment: https://www.gnu.org/software/libc/
What does ldd --version
show on your php8 docker image?
Debian Docker
ldd (Debian GLIBC 2.28-10) 2.28
Alpine Docker and now why I am seeing the problem
/var/www $ ldd --version
musl libc (x86_64)
Version 1.2.2
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
Looks like I need to find an apk for Alpine
BTW, I am in contact with libxl to check in on the builds and try to get a version of ldd and Glibc documented
OK. I am curious what changed in between 3.9.3.0 and 3.9.4.2, which effectively prohibited upgrading on CentOS/RHEL 6.
I was able to get 3.9.4.3 working with PHP:8-apache with php_excel now.
I have reached out to libxl to try and get access to the build and to try and get the supported build libraries supported or targetted
Here is my Dockerfile that looks to be working now...
FROM php:8-apache as build
ARG LIBXL_VERSION="3.9.4.3"
#ARG ZTS_VERSION="20190902"
ARG ZTS_VERSION="20200930"
RUN \
apt-get update -y \
&& apt-get install -y wget git \
# Install libXL
&& cd /tmp \
&& wget http://www.libxl.com/download/libxl-lin-${LIBXL_VERSION}.tar.gz \
&& tar -zxv -f libxl-lin-${LIBXL_VERSION}.tar.gz \
&& cp /tmp/libxl-${LIBXL_VERSION}/lib64/libxl.so /usr/local/lib/libxl.so \
&& mkdir -p /usr/local/include/libxl_c/ \
&& cp /tmp/libxl-${LIBXL_VERSION}/include_c/* /usr/local/include/libxl_c/ \
# Install php_excel
&& cd /tmp \
&& docker-php-source extract \
&& git clone https://github.com/Jan-E/php_excel.git -b php7_with_pulls \
&& cd /tmp/php_excel \
&& phpize \
&& ./configure \
--with-php-config=/usr/local/bin/php-config \
--with-libxl-incdir=/usr/local/include/libxl_c/ \
--with-libxml-dir=/usr/local/include/libxml2/ \
--with-excel=../libxl-${LIBXL_VERSION}/ \
&& make \
&& cp /tmp/php_excel/modules/excel.so \
/usr/local/lib/php/extensions/no-debug-non-zts-${ZTS_VERSION}/ \
&& cp /tmp/libxl-${LIBXL_VERSION}/lib64/libxl.so \
/usr/lib/libxl.so \
&& apt-get remove -y wget git \
&& docker-php-source delete
FROM php:8-apache
ARG LIBXL_VERSION="3.9.4.3"
#ARG ZTS_VERSION="20190902"
ARG ZTS_VERSION="20200930"
ARG build=local
ARG sha=n/a
ARG config=production
RUN \
apt-get update -y \
&& apt-get install -y libzip-dev libpng-dev \
&& docker-php-ext-install zip pdo_mysql gd calendar
COPY --from=build /usr/local/lib/php/extensions/no-debug-non-zts-${ZTS_VERSION}/excel.so /usr/local/lib/php/extensions/no-debug-non-zts-${ZTS_VERSION}/
COPY --from=build /usr/lib/libxl.so /usr/lib/
COPY ./config/excel.ini /usr/local/etc/php/conf.d/docker-php-ext-excel.ini
RUN docker-php-ext-enable excel
# Install PDFTK, wierd hack: pdftk requires
# opendjk-headless, openjdk-headless fails
# if /usr/share/man/man1 does not exist
RUN mkdir -p /usr/share/man/man1
RUN apt-get install -y pdftk
ENV VINOSHIPPER_ENVIRONMENT sandbox
COPY src/ /var/www/html/
COPY vendor/ /var/www/vendor/
#XDEBUG
RUN if [ "$config" = "xdebug" ]; \
then pecl install xdebug; \
else echo 'Skipping XDebug Installation'; \
fi
RUN echo "{\"build\":\"${build}\", \"Sha\":\"${sha}\", \"ip\":\"<?= \$_SERVER['SERVER_ADDR'] ?>\"}" > /var/www/build.php
COPY "config/${config}.ini" "$PHP_INI_DIR/php.ini"
BTW, you should be able to create PRs now @Jan-E
I was finally able to install it successfully.
running ./configure after
phpize
, I get the same error no matter the version of libxl downloaded.@Jan-E - might you have an idea concerning this? Might you need more information?