Having run into this issue recently, here's a patch (hopefully attached, mail.app and list filters willing) against PHP 5.3 to address it.
This patch will promote to double the file sizes that overflow LONG_MAX, which works transparently for my script.
Note that this only touches the obvious functions in the core; there may be other extensions that need to behave similarly.
The defines that I jam into CFLAGS are known to work in our other projects on Linux, Solaris, FreeBSD and OSX. The other (weirder) platforms might need some other adjustments to work correctly.
I wonder - if we enable this patch, and there's some library that PHP modules use, which is not compiled with 64-bit files support, will it work OK (including using PHP file handles, calling file functions, etc.)? I am worried about something like changing the structure of FILE* and then both modules using different settings would access it. So do you know how LF-enabled code interoperates with non-lf-enabled code?
Also I'm not sure MAKE_DOUBLE_ZVAL_INCREF is necessary - as I see, it's used only in 2 places.
--
Stanislav Malyshev, Zend Software Architect
stas@zend.com http://www.zend.com/
(408)253-8829 MSN: stas@zend.com