Bug #53829 [Com]: Compiling PHP with large file support will replace function gzopen by gzopen64

From: Date: Thu, 03 Jul 2014 15:42:11 +0000
Subject: Bug #53829 [Com]: Compiling PHP with large file support will replace function gzopen by gzopen64
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186449@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53829&edit=1 ID: 53829 Comment by: anthon at piwik dot org Reported by: rilatonal at hotmail dot de Summary: Compiling PHP with large file support will replace function gzopen by gzopen64 Status: Assigned Type: Bug Package: Zlib related Operating System: Linux PHP Version: 5.3.5 Assigned To: skettler Block user comment: N Private report: N New Comment: +1 This appears to be a problem with Ubuntu Trusty32 (zlib 1.2.8) where php appears to now expose gzopen64. (See http://dev.piwik.org/trac/ticket/5407) skettler's patch fixes this by undefining the problematic macros. (The other functions: gzoffset, adler32_combine, and crc32_combine are not used in the extension, ext/zlib/*) Previous Comments: ------------------------------------------------------------------------ [2013-03-03 00:25:47] bjori@php.net skettler: Any need for that ifdef? Can't we always use the RAW macro? And what about the other functions he mentioned in this report? ------------------------------------------------------------------------ [2013-02-08 12:26:10] skettler@php.net Added patch "zlib-largefile-function-renaming" that fixes the gzopen, gzseek and gztell PHP function renaming. ------------------------------------------------------------------------ [2013-02-08 12:24:51] skettler@php.net The following patch has been added/updated: Patch Name: zlib-largefile-function-renaming Revision: 1360326291 URL: https://bugs.php.net/patch-display.php?bug=53829&patch=zlib-largefile-function-renaming&revision=1360326291 ------------------------------------------------------------------------ [2012-08-26 11:07:08] comments at sentfrom dot com I encountered the same problem with a 64-bit build of PHP on OpenIndiana b151. The symptom I saw was Wordpress automatic updates were failing silently, because the class-pclzip.php module tests for the presence of gzopen. Patching that file is not a viable option since any WP update can overwrite it again. The gzopen patch attached fixes this at the PHP level by using lower-level ZEND macros that are not affected by zlib.h's #define gzopen gzopen64. It is preferable to using an undocumented zlib compilation flag ZLIB_INTERNAL, which may go away at some point in the future. I had to use ZEND_RAW_FENTRY as it does not have a PHP_ equivalent, and we have to pass the first argument "gzopen" as a string, since cpp would replace gzopen with gzopen64 if passed as a C identifier. ------------------------------------------------------------------------ [2011-09-07 07:09:20] tx-7-12 at tuxad dot com Hi, I also got this "bug" with the latest zlib 1.2.5 as system lib and "-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1". Dirty solution: Define ZLIB_INTERNAL. # /usr/local/php/bin/php -r 'var_dump(function_exists("gzopen"));' bool(false) # export CFLAGS="... -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -DZLIB_INTERNAL=1" configure && make # sapi/cli/php -r 'var_dump(function_exists("gzopen"));' bool(true) Matching lines in zlib.h: #if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFILE-0 # define gzopen gzopen64 # define gzseek gzseek64 # define gztell gztell64 # define gzoffset gzoffset64 # define adler32_combine adler32_combine64 # define crc32_combine crc32_combine64 # ifdef _LARGEFILE64_SOURCE ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); # endif #else ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); #endif Frank ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=53829 -- Edit this bug report at https://bugs.php.net/bug.php?id=53829&edit=1

« previous php.bugs (#186449) next »