LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-16-2011, 02:38 PM   #1
Nemus
Member
 
Registered: Apr 2007
Distribution: Fedora/Ubuntu
Posts: 63

Rep: Reputation: 15
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
 
Old 02-16-2011, 02:50 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
CFLAGS="-D_FILE_OFFSET_BITS=64"

then run ./configure
 
1 members found this post helpful.
Old 02-16-2011, 02:53 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400
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.
 
1 members found this post helpful.
Old 02-17-2011, 11:40 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,237

Rep: Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656Reputation: 1656
Quote:
Originally Posted by druuna View Post
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.
 
1 members found this post helpful.
Old 02-17-2011, 12:13 PM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400
Hi,
Quote:
Originally Posted by szboardstretcher View Post
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.
 
1 members found this post helpful.
Old 02-18-2011, 12:47 AM   #6
Nemus
Member
 
Registered: Apr 2007
Distribution: Fedora/Ubuntu
Posts: 63

Original Poster
Rep: Reputation: 15
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!
 
Old 02-18-2011, 02:03 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400
Hi,

Glad to see you got it solved.

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

@szboardstretcher: Seems you were correct
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting larger files over n/w aarsh Linux - Newbie 5 05-17-2010 09:52 AM
File corruption during IOZONE tests with 8GB or larger test files digr Linux - Software 2 04-22-2009 06:55 PM
Unable to open files larger than 2GB thunder44 Linux - Software 2 08-18-2008 03:25 AM
php software can not download larger size files xiexusheeboard Linux - Newbie 1 06-23-2008 07:48 AM
Can't resume file transfer on files larger than 1 gig dalesan Linux - Newbie 2 10-11-2005 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration