php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68302 impossible to compile php with zip support
Submitted: 2014-10-24 16:43 UTC Modified: 2021-11-08 21:40 UTC
Votes:21
Avg. Score:4.4 ± 0.8
Reproduced:18 of 18 (100.0%)
Same Version:10 (55.6%)
Same OS:10 (55.6%)
From: 0kaba0 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.6.2 OS: Centos 6.5
Private report: No CVE-ID: None
 [2014-10-24 16:43 UTC] 0kaba0 at gmail dot com
Description:
------------
Compilation fails with the error:

/bin/sh /usr/local/src/php-5.6.2/libtool --silent --preserve-dup-deps --mode=compile cc  -Iext/zip/ -I/usr/local/src/php-5.6.2/ext/zip/ -DPHP_ATOM_INC -I/usr/local/src/php-5.6.2/include -I/usr/local/src/php-5.6.2/main -I/usr/local/src/php-5.6.2 -I/usr/local/src/php-5.6.2/ext/date/lib -I/usr/local/src/php-5.6.2/ext/ereg/regex -I/opt/xml2/include/libxml2 -I/opt/pcre/include -I/opt/curlssl//include -I/usr/X11 -I/usr/include/freetype2 -I/opt/php_with_imap_client//include -I/usr/local/src/php-5.6.2/ext/mbstring/oniguruma -I/usr/local/src/php-5.6.2/ext/mbstring/libmbfl -I/usr/local/src/php-5.6.2/ext/mbstring/libmbfl/mbfl -I/opt/libmcrypt//include -I/usr/include/mysql -I/opt/tidy//include -I/opt/xslt/include -I/opt/xslt//include -I/usr/local/src/php-5.6.2/ext/zip/lib -I/usr/local/src/php-5.6.2/TSRM -I/usr/local/src/php-5.6.2/Zend    -I/usr/include -g -O2 -fvisibility=hidden  -prefer-pic -c /usr/local/src/php-5.6.2/ext/zip/lib/zip_add.c -o ext/zip/lib/zip_add.lo 
In file included from /usr/local/src/php-5.6.2/ext/zip/lib/zip_add.c:37:
/usr/local/src/php-5.6.2/ext/zip/lib/zipint.h:118:2: error: #error unsupported size of off_t
make: *** [ext/zip/lib/zip_add.lo] Error 1


Test script:
---------------
./configure \
    --prefix=/usr/local/php/5.6 \
    --exec-prefix=/usr/local/php/5.6 \
    --with-config-file-path=/usr/local/php/5.6 \
    --disable-fileinfo \
    --enable-bcmath \
    --enable-calendar \
    --enable-exif \
    --enable-ftp \
    --enable-gd-native-ttf \
    --enable-libxml \
    --enable-mbstring \
    --enable-soap \
    --enable-sockets \
    --enable-wddx \
    --with-bz2 \
    --enable-zip \
    --with-curl=/opt/curlssl/ \
    --with-freetype-dir=/usr \
    --with-gd \
    --with-gettext \
    --with-imap=/opt/php_with_imap_client/ \
    --with-imap-ssl=/usr \
    --with-jpeg-dir=/usr \
    --with-kerberos \
    --with-libdir=lib64 \
    --with-libexpat-dir=/usr \
    --with-libxml-dir=/opt/xml2 \
    --with-libxml-dir=/opt/xml2/ \
    --with-mcrypt=/opt/libmcrypt/ \
    --with-mysql=/usr \
    --with-mysql-sock=/var/lib/mysql/mysql.sock \
    --with-mysqli=/usr/bin/mysql_config \
    --with-openssl=/usr \
    --with-openssl-dir=/usr \
    --with-pcre-regex=/opt/pcre \
    --with-sqlite3=shared \
    --enable-pdo=shared \
    --with-pdo-mysql=shared \
    --with-pdo-sqlite=shared,/usr \
    --with-pdo-pgsql=shared \
    --with-pgsql=/usr \
    --with-pic \
    --with-png-dir=/usr \
    --with-tidy=/opt/tidy/ \
    --with-xmlrpc \
    --with-xpm-dir=/usr \
    --with-xsl=/opt/xslt/ \
    --with-zlib \
    --with-zlib-dir=/usr \
    --with-iconv \
    --enable-cli


Expected result:
----------------
compile without error


Actual result:
--------------
error


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-10-24 17:05 UTC] aharvey@php.net
-Status: Open +Status: Feedback
 [2014-10-24 17:05 UTC] aharvey@php.net
PHP 5.6.2 with --enable-zip builds OK for me on a stock CentOS 6.5 x86-64 VM (and passes the test suite). What architecture and compiler are you running on?

Beyond that, the best thing to do is probably to attempt to isolate what combination of configure options causes the build to fail: start with ./configure --enable-zip, and then gradually reintroduce each --with and --enable option until the build fails. My suspicion is that one of the custom library builds that is being used is somehow stomping on the SIZEOF_OFF_T #define.
 [2014-10-24 19:38 UTC] 0kaba0 at gmail dot com
-Status: Feedback +Status: Open
 [2014-10-24 19:38 UTC] 0kaba0 at gmail dot com
# uname -i
x86_64

# rpm -qa | grep gcc
libgcc-4.4.7-4.el6.x86_64
gcc-c++-4.4.7-4.el6.x86_64
gcc-4.4.7-4.el6.x86_64

I tried to compile PHP 5.6 with following keys:

#./configure --enable-zip --with-libzip

and this is not generate any errors. 

But if I use the following keys:

#./configure --enable-zip --with-libzip --with-xsl=/opt/xslt

then I receive the following error: 

checking for libzip... from pkgconfig: version 0.11.2 found in /usr/lib64
checking for zip_open in -lzip... no
configure: error: could not find usable libzip

If I use the following keys:

#./configure --enable-zip --with-xsl=/opt/xslt

then its done without errors, but compilation is stopped with first error.

Compiling a different version of PHP (5.3, 5.4 or 5.5) with this xslt library does not cause such problem.

Any ideas ?
 [2014-12-21 18:19 UTC] avarsanov at yahoo dot com
I had the same error, while compiling PHP (5.6.4, but that does not matter, because I tried als PHP 5.6.3 and was reproducable) on Debian GNU/Linux. I saw that problem when I forgot to set LD_LIBRARY_PATH environment variable.

So doing it like that solved my problem:

$ export LD_LIBRARY_PATH=/usr/local/mysql/lib
$ ./configure --enable-fpm --with-mcrypt --with-zlib --with-curl --disable-debug --disable-rpath --enable-inline-optimization --with-bz2 --enable-sockets --enable-zip --with-fpm-user=www-data --with-fpm-group=www-data --with-mysql=/usr/local/mysql/
$ make
$ make test
# export LD_LIBRARY_PATH=/usr/local/mysql/lib
# make install
 [2015-01-26 13:26 UTC] showerheadsuk at hotmail dot com
I had the same problem when trying to compile PHP 5.6.5. Eventually I managed to track it down to using tidy-nu ( https://github.com/geoffmcl/tidy-fork/tree/geoffmcl-restart ) rather than tidy
 [2015-02-21 15:38 UTC] jrpozo at conclase dot net
You have to tell configure that you have libxml2 in a non-standard location, otherwise it will get a compile error when trying to determine the size of the "off_t" type. You can see version mismatch errors between libxslt and libxml2 in config.log as it first finds the RPM-provided libxml2 library at /usr/lib64 instead of the libxml2 library at /opt/xml2 that /opt/xlst is linked against.

To fix, execute:

export CFLAGS="-L/opt/xml2/lib"

then run the configure command.
 [2015-06-02 10:41 UTC] ScullyZ at posteo dot net
I have the same problem, but maybe i can help a bit.

I have to compile PHP 5.6 (with PostgreSQL, GD, libxml, calendar, zip, curl, freetype, ldap, apache, gettext and fpm) on a SLES Server (Version 11.3). After install all dependencies (postgresql-devel, gd-devel, libxml2-devel ...) I have the same Error, by execute the make-command.

I wanted to show in the files, they are realated with the error (zipint.h, zip_add.lo) and saw, that the .lo-File, what was builded from libtool in the last logged step, has the wront name. It will named ext/zip/lib/zip_add.loT and not ext/zip/lib/zip_add.lo.
When you rename the file, continue with "make", rename the next file and so on ... you have a working workaround. But you get crazy, there many Files (85) to rename and many times, you must continue ... Im searching for the position, were the waste T comes from ... Or for his right to exist.
 [2015-06-02 11:05 UTC] ScullyZ at posteo dot net
Oh, I think, I have found the right of exist of this T. Embarrassing ... for me. Realy.

This T is perhaps a testflag and exists, because of libtool crashes bevor line 1449 ... But now I'm wondering, why it's work.
 [2015-09-10 04:39 UTC] ax at jentian dot com
Remove --with-pdo-pgsql  pass.
 [2016-03-16 18:12 UTC] michael dot duelm at giata dot de
Compilation also fails with 5.6.18 and 5.6.19

./php-5.6.18/ext/zip/lib/zipint.h:118:2: error: #error unsupported size of off_t
make: *** [ext/zip/lib/zip_add.lo] Error 1

'./configure' \
'--with-libdir=lib64' \
'--with-jpeg-dir' \
'--enable-ftp' \
'--with-mysql=/usr/local/mysql' \
'--with-mysqli=/usr/local/mysql/bin/mysql_config' \
'--enable-pdo' \
'--with-pdo-mysql=/usr/local/mysql' \
'--with-pdo-sqlite' \
'--with-pdo-firebird=shared,/opt/firebird' \
'--with-libxml-dir=/usr/local/lib' \
'--enable-soap' \
'--with-zlib' \
'--disable-cgi' \
'--with-gd' \
'--with-xsl' \
'--with-mcrypt=/usr/lib' \
'--with-openssl' \
'--enable-mbstring' \
'--enable-mbregex' \
'--with-interbase=shared,/opt/firebird' \
'--enable-zip' \
'--enable-bcmath'
 [2016-05-24 05:52 UTC] nulash2010cool at gmail dot com
I also have the same error.. Pls help.

My specification: CentOs 6.5, MySQL 5.6.30 Apache 2.4.20 Php 5.6.21

The line i used to configure:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-mysql=/usr/local/mysql/

Output obtained:
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1901: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/node.c:1907: undefined reference to `xmlOutputBufferGetContent'
ext/dom/.libs/documenttype.o: In function `dom_documenttype_internal_subset_read':
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
/usr/local/src/php/php-5.6.21/ext/dom/documenttype.c:214: undefined reference to `xmlOutputBufferGetSize'
ext/simplexml/.libs/simplexml.o: In function `zim_simplexml_element_asXML':
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetContent'
/usr/local/src/php/php-5.6.21/ext/simplexml/simplexml.c:1428: undefined reference to `xmlOutputBufferGetSize'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
 [2016-06-28 18:41 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2016-06-28 18:41 UTC] cmb@php.net
> error: #error unsupported size of off_t

I wonder to what SIZEOF_OFF_T is defined. See main/php_config.h.
 [2016-07-10 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2016-07-19 16:34 UTC] pzawora at gmail dot com
It happens when SIZEOF_OFF_T is set to ZERO

To determine SIZEOF_OFF_T  ./configure does not check errors on compilation.
Error could be caused by any missing library (ie pg.so).

configure:106255: cc -o conftest -I/usr/include ....... -lxml2 -lz -lm -ldl >&5

To reproduce try to remove any (usable) library from ldconfig path
 [2016-07-19 17:29 UTC] cmb@php.net
-Status: No Feedback +Status: Open
 [2016-07-19 17:29 UTC] cmb@php.net
@pzawora Thanks.
 [2016-08-17 10:50 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=48198e4c257825ab89ee027bff5a93fc2cd59601
Log: Fix #68302: impossible to compile php with zip support
 [2016-08-17 10:50 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2016-10-17 10:09 UTC] bwoebi@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=48198e4c257825ab89ee027bff5a93fc2cd59601
Log: Fix #68302: impossible to compile php with zip support
 [2021-11-08 20:17 UTC] mtbox74 at gmail dot com
I'm getting something similar(PHP 7.4) when combining --with-zlib --with-zip --with-pdo-pgsql. It says:

ext/zip/.libs/php_zip.o: In function `c_ziparchive_setEncryptionName':
/trusty/Downloads/php-7.4.24/ext/zip/php_zip.c:2252: undefined reference to `zip_file_set_encryption'
ext/zip/.libs/php_zip.o: In function `c_ziparchive_setEncryptionIndex':
/trusty/Downloads/php-7.4.24/ext/zip/php_zip.c:2276: undefined reference to `zip_file_set_encryption'
ext/zip/.libs/php_zip.o: In function `zm_startup_zip':
/trusty/Downloads/php-7.4.24/ext/zip/php_zip.c:3197: undefined reference to `zip_libzip_version'
ext/zip/.libs/php_zip.o: In function `zm_info_zip':
/trusty/Downloads/php-7.4.24/ext/zip/php_zip.c:3231: undefined reference to `zip_libzip_version'
collect2: error: ld returned 1 exit status
Makefile:293: recipe for target 'sapi/cli/php' failed
make: *** [sapi/cli/php] Error 1

If I remove --with-pdo-pgsql no errors appears.
System: xbuntu 18.04. I've installed manually zlib 1.5.2 to use encryptions methods provided by zip.
I can compile with pdo-mysql but not with pdo-pgsql :(
 [2021-11-08 21:40 UTC] cmb@php.net
> I'm getting something similar […]

That does not look related; please open a new bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC