Max file size in fopen()

Max file size in fopen()

am 19.02.2010 20:42:07 von Darvin Denmian

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.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Max file size in fopen()

am 19.02.2010 20:49:10 von Ashley Sheridan

--=-kapfsjYtMz98r7DuKnXb
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

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



--=-kapfsjYtMz98r7DuKnXb--