viest / php-ext-xlswriter

🚀 PHP Extension for creating and reader XLSX files.
https://xlswriter.viest.me
BSD 2-Clause "Simplified" License
2.25k stars 232 forks source link

centos安装扩展失败 #134

Closed needrunning closed 5 years ago

needrunning commented 5 years ago

编译最后一步

sudo make && make install

In file included from /usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:186:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:35: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:65: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/crypt.h:94: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zipOpenNewFileInZip4_64’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1245: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1251: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1254: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1255: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zip64FlushWriteBuffer’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c: In function ‘zipCloseFileInZipRaw64’:
/usr/local/src/php-ext-excel-export/library/third_party/minizip/zip.c:1610: error: ‘curfile64_info’ has no member named ‘crypt_header_size’
make: *** [library/third_party/minizip/zip.lo] Error 1

环境 PHP 7.2.13 (cli) (built: Dec 8 2018 12:27:01) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.7, Copyright (c) 1999-2018, by Zend Technologies

rinting-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.7 (Final) Release: 6.7 Codename: Final

viest commented 5 years ago

zlib 依赖是否安装?

needrunning commented 5 years ago

这个安装过的。

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: viest notifications@github.com 发送时间: 2019年6月30日 15:25 收件人: viest/php-ext-excel-export php-ext-excel-export@noreply.github.com 抄送: needrunning 610212129@qq.com, Author author@noreply.github.com 主题: 回复:[viest/php-ext-excel-export] centos安装扩展失败 (#134)

zlib 依赖是否安装?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

remicollet commented 5 years ago

On CentOS, don't build from sources, simply use https://rpms.remirepo.net/ Which have nearly all extensions available, including this one, for all PHP versions (5.4 to 7.4)

viest commented 5 years ago

@remicollet 👍

needrunning commented 5 years ago

@remicollet 👍

看了链接 不太明白啊 那如何解决这个扩展安装失败问题?

viest commented 5 years ago

@needrunning

https://rpms.remirepo.net/wizard/

选择你的系统版本、PHP版本、安装类型,下面会生成一个使用向导。

viest commented 5 years ago

@needrunning 我将重新开启这个 issues ,待解决时关闭。

remicollet commented 5 years ago

Would be nice to use english....

viest commented 5 years ago

@remicollet

I will create a new issue to guide the user to use https://rpms.remirepo.net/

Pinned issue #137

viest commented 5 years ago

@needrunning

Has your problem been solved?

needrunning commented 5 years ago

@needrunning

Has your problem been solved?

I'm working on something that hasn't been solved yet

needrunning commented 5 years ago

@needrunning

Has your problem been solved?

now I have two problems

one: in order to install pxlswriter via pecl install pxlswriter, Do you need to reinstall PHP?

two: I have runed pecl install pxlswriter in my server , As shown below

lude/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/tmp/pear/install/xlswriter/library/include -I/tmp/pear/install/xlswriter -I/tmp/pear/install/xlswriter/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c -fPIC -DPIC -o library/third_party/minizip/.libs/zip.o /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:160: error: expected ‘:’, ‘,’, ‘;’, ‘}’ or ‘attribute’ before ‘’ token In file included from /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:186: /tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:35: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token /tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token /tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:65: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token /tmp/pear/install/xlswriter/library/third_party/minizip/crypt.h:94: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c: In function ‘zipOpenNewFileInZip4_64’: /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1245: error: ‘curfile64_info’ has no member named ‘crypt_header_size’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1251: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1254: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1255: error: ‘curfile64_info’ has no member named ‘crypt_header_size’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c: In function ‘zip64FlushWriteBuffer’: /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1375: error: ‘curfile64_info’ has no member named ‘pcrc_32_tab’ /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c: In function ‘zipCloseFileInZipRaw64’: /tmp/pear/install/xlswriter/library/third_party/minizip/zip.c:1610: error: ‘curfile64_info’ has no member named ‘crypt_header_size’ make: *** [library/third_party/minizip/zip.lo] Error 1

remicollet commented 5 years ago

There is 2 ways

1/ build everything from sources (php, libraries, extensions...)

notice : "pecl install" is building from sources

2/ use the package manager and rely on a good packages provider

How was installed you PHP ?

Using "remi" is the most easy way (and the only provider for CentoOS 6, only 3rd party repo only provide new PHP versions for C7)

Nothing need to be built from sources

yum install php-pecl-xlswriter

remicollet commented 5 years ago

@viest BTW, I confirm that building from sources xlswriter using bundled library doesn't work on old CentOS 6 with old compiler and old system tools / libraries.

C6 is now terrible old (9 years), and will be EOL in a few months (Nov 2020).

RPM packages build fine on C6, but only use the system library which is built separately, with another build system (cmake), which probably detect more needed compatibility options.

viest commented 5 years ago

@remicollet The serious backwardness of the CentOS version is indeed a problem.

viest commented 5 years ago

@remicollet I will post an emergency fix version 1.2.6

remicollet commented 5 years ago

The serious backwardness of the CentOS version is indeed a problem.

https://twitter.com/RemiCollet/status/903155214441738240 ;)

viest commented 5 years ago

@remicollet Thank you for your contribution 👍