iliaal / php_excel

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

ERROR :make - PHP7 + Ubuntu16 on AWS #250

Closed stone256 closed 3 years ago

stone256 commented 5 years ago

l# make /bin/bash /root/libxl/php_excel/libtool --mode=compile cc -I. -I/root/libxl/php_excel -DPHP_ATOM_INC -I/root/libxl/php_excel/include -I/root/libxl/php_excel/main -I/root/libxl/php_excel -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libxl/libxl-3.8.4.0/include_c -I/usr/include/libxml2/ -DHAVE_CONFIG_H -g -O2 -c /root/libxl/php_excel/excel.c -o excel.lo libtool: compile: cc -I. -I/root/libxl/php_excel -DPHP_ATOM_INC -I/root/libxl/php_excel/include -I/root/libxl/php_excel/main -I/root/libxl/php_excel -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -I/root/libxl/libxl-3.8.4.0/include_c -I/usr/include/libxml2/ -DHAVE_CONFIG_H -g -O2 -c /root/libxl/php_excel/excel.c -fPIC -DPIC -o .libs/excel.o In file included from /usr/include/php/20151012/Zend/zend.h:31:0, from /usr/include/php/20151012/main/php.h:36, from /root/libxl/php_excel/excel.c:26: /root/libxl/php_excel/excel.c: In function âzim_ExcelSheet_insertRowâ: /root/libxl/libxl-3.8.4.0/include_c/libxl.h:428:30: ### error: too few arguments to function âxlSheetInsertRowAâ

define xlSheetInsertRow xlSheetInsertRowA

                          ^

/usr/include/php/20151012/Zend/zend_types.h:605:5: note: in definition of macro âZVAL_BOOLâ (b) ? IS_TRUE : IS_FALSE; \ ^ /usr/include/php/20151012/Zend/zend_API.h:629:31: note: in expansion of macro âRETVAL_BOOLâ

define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }

                           ^

/root/libxl/php_excel/excel.c:2585:3: note: in expansion of macro âRETURN_BOOLâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2585:15: note: in expansion of macro âxlSheetInsertRowâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2622:2: note: in expansion of macro âPHP_EXCEL_SHEET_GET_BOOL_STATEâ PHP_EXCEL_SHEET_GET_BOOL_STATE(InsertRow) ^ In file included from /root/libxl/libxl-3.8.4.0/include_c/libxl.h:308:0, from /root/libxl/php_excel/excel.c:23: /root/libxl/libxl-3.8.4.0/include_c/SheetA.h:98:37: note: declared here XLAPI int XLAPIENTRY xlSheetInsertRowA(SheetHandle handle, int rowFirst, int rowLast, int updateNamedRanges); ^ In file included from /usr/include/php/20151012/Zend/zend.h:31:0, from /usr/include/php/20151012/main/php.h:36, from /root/libxl/php_excel/excel.c:26: /root/libxl/php_excel/excel.c: In function âzim_ExcelSheet_insertColâ: /root/libxl/libxl-3.8.4.0/include_c/libxl.h:427:30: **### error: too few arguments to function âxlSheetInsertColAâ

define xlSheetInsertCol xlSheetInsertColA**

                          ^

/usr/include/php/20151012/Zend/zend_types.h:605:5: note: in definition of macro âZVAL_BOOLâ (b) ? IS_TRUE : IS_FALSE; \ ^ /usr/include/php/20151012/Zend/zend_API.h:629:31: note: in expansion of macro âRETVAL_BOOLâ

define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }

                           ^

/root/libxl/php_excel/excel.c:2585:3: note: in expansion of macro âRETURN_BOOLâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2585:15: note: in expansion of macro âxlSheetInsertColâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2630:2: note: in expansion of macro âPHP_EXCEL_SHEET_GET_BOOL_STATEâ PHP_EXCEL_SHEET_GET_BOOL_STATE(InsertCol) ^ In file included from /root/libxl/libxl-3.8.4.0/include_c/libxl.h:308:0, from /root/libxl/php_excel/excel.c:23: /root/libxl/libxl-3.8.4.0/include_c/SheetA.h:97:37: note: declared here XLAPI int XLAPIENTRY xlSheetInsertColA(SheetHandle handle, int colFirst, int colLast, int updateNamedRanges); ^ In file included from /usr/include/php/20151012/Zend/zend.h:31:0, from /usr/include/php/20151012/main/php.h:36, from /root/libxl/php_excel/excel.c:26: /root/libxl/php_excel/excel.c: In function âzim_ExcelSheet_removeRowâ: /root/libxl/libxl-3.8.4.0/include_c/libxl.h:430:30: ### error: too few arguments to function âxlSheetRemoveRowAâ

define xlSheetRemoveRow xlSheetRemoveRowA

                          ^

/usr/include/php/20151012/Zend/zend_types.h:605:5: note: in definition of macro âZVAL_BOOLâ (b) ? IS_TRUE : IS_FALSE; \ ^ /usr/include/php/20151012/Zend/zend_API.h:629:31: note: in expansion of macro âRETVAL_BOOLâ

define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }

                           ^

/root/libxl/php_excel/excel.c:2585:3: note: in expansion of macro âRETURN_BOOLâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2585:15: note: in expansion of macro âxlSheetRemoveRowâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2638:2: note: in expansion of macro âPHP_EXCEL_SHEET_GET_BOOL_STATEâ PHP_EXCEL_SHEET_GET_BOOL_STATE(RemoveRow) ^ In file included from /root/libxl/libxl-3.8.4.0/include_c/libxl.h:308:0, from /root/libxl/php_excel/excel.c:23: /root/libxl/libxl-3.8.4.0/include_c/SheetA.h:100:37: note: declared here XLAPI int XLAPIENTRY xlSheetRemoveRowA(SheetHandle handle, int rowFirst, int rowLast, int updateNamedRanges); ^ In file included from /usr/include/php/20151012/Zend/zend.h:31:0, from /usr/include/php/20151012/main/php.h:36, from /root/libxl/php_excel/excel.c:26: /root/libxl/php_excel/excel.c: In function âzim_ExcelSheet_removeColâ: /root/libxl/libxl-3.8.4.0/include_c/libxl.h:429:30: ### error: too few arguments to function âxlSheetRemoveColAâ

define xlSheetRemoveCol xlSheetRemoveColA

                          ^

/usr/include/php/20151012/Zend/zend_types.h:605:5: note: in definition of macro âZVAL_BOOLâ (b) ? IS_TRUE : IS_FALSE; \ ^ /usr/include/php/20151012/Zend/zend_API.h:629:31: note: in expansion of macro âRETVAL_BOOLâ

define RETURN_BOOL(b) { RETVAL_BOOL(b); return; }

                           ^

/root/libxl/php_excel/excel.c:2585:3: note: in expansion of macro âRETURN_BOOLâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2585:15: note: in expansion of macro âxlSheetRemoveColâ RETURN_BOOL(xlSheet ## func_name (sheet, r, c)); \ ^ /root/libxl/php_excel/excel.c:2646:2: note: in expansion of macro âPHP_EXCEL_SHEET_GET_BOOL_STATEâ PHP_EXCEL_SHEET_GET_BOOL_STATE(RemoveCol) ^ In file included from /root/libxl/libxl-3.8.4.0/include_c/libxl.h:308:0, from /root/libxl/php_excel/excel.c:23: /root/libxl/libxl-3.8.4.0/include_c/SheetA.h:99:37: note: declared here XLAPI int XLAPIENTRY xlSheetRemoveColA(SheetHandle handle, int colFirst, int colLast, int updateNamedRanges); ^ /root/libxl/php_excel/excel.c: In function âzim_ExcelSheet_tableâ: /root/libxl/php_excel/excel.c:4669:42: warning: passing argument 3 of âxlSheetTableAâ from incompatible pointer type [-Wincompatible-pointer-types] if (!(name = xlSheetTable(sheet, index, &rowFirst, &rowLast, &colFirst, &colLast, &headerRowCount, &totalsRowCount))) { ^ In file included from /root/libxl/libxl-3.8.4.0/include_c/libxl.h:308:0, from /root/libxl/php_excel/excel.c:23: /root/libxl/libxl-3.8.4.0/include_c/SheetA.h:179:37: note: expected âint â but argument is of type âzend_long {aka long int }â XLAPI const char XLAPIENTRY xlSheetTableA(SheetHandle handle, int index, int rowFirst, int rowLast, int colFirst, int colLast, int* he ^ /root/libxl/php_excel/excel.c:4669:53: warning: passing argument 4 of âxlSheetTableAâ from incompatible pointer type [-Wincompatible-pointer-types] if (!(name = xlSheetTable(sheet, index, &rowFirst, &rowLast, &colFirst, &colLast, &headerRowCount, &totalsRowCount))) { ^

peter279k commented 4 years ago

It looks like this extension is not compatible with php-7.x because the extension development approach on php-5.x is different from php-7.x.

The Make error is regular at this moment I think.

peter279k commented 4 years ago

After researching this issue, it looks like this issue is related to issue #234 and #248.

It only works on Ubuntu 18.04 with php-7.2 and binding extension with latest libXL version.

I also use the forked repository on php7-issue234 branch.

Here is my Dockerfile:

ROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install php7.2-dev libxml2-dev git wget -y
RUN ln -fs /usr/share/zoneinfo/Asia_Taipei /etc/localtime \
    && dpkg-reconfigure tzdata
RUN wget http://libxl.com/download/libxl-lin-3.8.5.tar.gz \
    && tar -zxv -f libxl-lin-3.8.5.tar.gz \
    && cd libxl-3.8.5.0/ \
    && cp lib64/libxl.so /usr/lib/libxl.so \
    && mkdir -p /usr/include/libxl_c/ \
    && cp include_c/* /usr/include/libxl_c/
RUN git clone https://github.com/Jan-E/php_excel -b php7-issue234
RUN cd php_excel \
    && phpize \
    && ./configure --with-php-config=/usr/bin/php-config --with-libxl-incdir=/usr/include/libxl_c/ --with-libxml-dir=/usr/include/libxml2/ --with-excel \
    && make \
    && make install
peter279k commented 4 years ago

It can work on Ubuntu 18.04 with php-7.2 and libXL 3.7.2 version on this repository under php7 branch.

Here is my Dockerfile I build:

ROM ubuntu:18.04
ENV DEBIAN_FRONTEND noninteractive

RUN apt-get update
RUN apt-get install php7.2-dev libxml2-dev git wget -y
RUN ln -fs /usr/share/zoneinfo/Asia_Taipei /etc/localtime \
    && dpkg-reconfigure tzdata
RUN wget http://libxl.com/download/libxl-lin-3.7.2.tar.gz \
    && tar -zxv -f libxl-lin-3.7.2.tar.gz \
    && cd libxl-3.7.2.0/ \
    && cp lib64/libxl.so /usr/lib/libxl.so \
    && mkdir -p /usr/include/libxl_c/ \
    && cp include_c/* /usr/include/libxl_c/
RUN git clone https://github.com/iliaal/php_excel -b php7
RUN cd php_excel \
    && phpize \
    && ./configure --with-php-config=/usr/bin/php-config --with-libxl-incdir=/usr/include/libxl_c/ --with-libxml-dir=/usr/include/libxml2/ --with-excel \
    && make \
    && make install