From: Darvin Denmian on 19 Feb 2010 14:42 Hello, I need to open a file with more than 2GB but the following error occurs: failed to open stream: Value too large for defined data type in /srv/www/sandboxes/dev02/test.php on line 2 I'm running this php in a 32 bits system. Googling I found that with the option "CFLAGS="-D_FILE_OFFSET_BITS=64"" the problem can be solved. Will I have this issue in a 64 bits System? Is there some recognized solution for this issue? Thanks.
From: Ashley Sheridan on 19 Feb 2010 14:49 On Fri, 2010-02-19 at 17:42 -0200, Darvin Denmian wrote: > Hello, > > I need to open a file with more than 2GB but the following error occurs: > > failed to open stream: Value too large for defined data type in > /srv/www/sandboxes/dev02/test.php on line 2 > > I'm running this php in a 32 bits system. > > Googling I found that with the option > "CFLAGS="-D_FILE_OFFSET_BITS=64"" the problem can be solved. > > Will I have this issue in a 64 bits System? > > Is there some recognized solution for this issue? > > Thanks. > 32-bit PHP has quite a few problems with large files. I ran into an odd one where I couldn't even get the dates from a file that was over 2GB! I think you may be running into something similar here, where some value that is needed to work with the file is going over the maximum that 32-bit can handle. 64-bit should fix the problem, but if you're in doubt, you could try testing it on a VM first? Thanks, Ash http://www.ashleysheridan.co.uk
|
Pages: 1 Prev: Advice on maintaining public and private files Next: Excel Spreadsheets and PHP |