LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   PHP File open larger files or fopen files larger than 2gigs (https://www.linuxquestions.org/questions/linux-server-73/php-file-open-larger-files-or-fopen-files-larger-than-2gigs-863129/)

Nemus 02-16-2011 01:38 PM

PHP File open larger files or fopen files larger than 2gigs
 
I have a ubuntu 10.10 server with apaceh2 and php and I want to open a file larger than 2gigs

I've read there is a flag that needs to be compiled into php to do this ?

I am not sure about it .

Could someone please advise thank you

szboardstretcher 02-16-2011 01:50 PM

CFLAGS="-D_FILE_OFFSET_BITS=64"

then run ./configure

druuna 02-16-2011 01:53 PM

Hi,

You probably need to edit your php.ini file (make a backup first).

Look for this option: post_max_size and set it to the appropriate size.

Here's a page with more info (about halfway down the page): Description of core php.ini directives

Restart apache after the edit.

Hope this helps.

szboardstretcher 02-17-2011 10:40 AM

Quote:

Originally Posted by druuna (Post 4260650)
Hi,

You probably need to edit your php.ini file (make a backup first).

Look for this option: post_max_size and set it to the appropriate size.

Here's a page with more info (about halfway down the page): Description of core php.ini directives

Restart apache after the edit.

Hope this helps.

Thats for uploads. He wants to "open" a file -- which is made possible by the flags I mentioned.

druuna 02-17-2011 11:13 AM

Hi,
Quote:

Originally Posted by szboardstretcher (Post 4261690)
Thats for uploads. He wants to "open" a file -- which is made possible by the flags I mentioned.

No, upload_max_filesize is for uploads, although post_max_size also affects file upload (have a look at the link I posted).

I have to admit that the OP's question is ambiguous and can be interpreted in a few ways. The OP might even be running into the 2Gb limit on 32 bit linux systems.... Ubuntu Desktop 10.10 recommends the 32 bits version, Ubuntu Server on the other hand recommends the 64 bit version.

We haven't heard from the OP since s/he posted the question, lets wait and see what the real problem is.

Nemus 02-17-2011 11:47 PM

PHP File Open
 
Thanks for the info I was able to get the bigger file loads by compiling with the CFLAGS="-D_FILE_OFFSET_BITS=64" thanks again it was a giant pain in the butt. Now we can parse giant files with php YAH!

druuna 02-18-2011 01:03 AM

Hi,

Glad to see you got it solved.

Can you put up the [SOLVED] tag (first post -> Thread Tools).

@szboardstretcher: Seems you were correct :)


All times are GMT -5. The time now is 05:10 PM.