LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 01: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, 01:50 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

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

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

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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, 10:40 AM   #4
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
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, 11:13 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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-17-2011, 11:47 PM   #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, 01:03 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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



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 08:52 AM
File corruption during IOZONE tests with 8GB or larger test files digr Linux - Software 2 04-22-2009 05:55 PM
Unable to open files larger than 2GB thunder44 Linux - Software 2 08-18-2008 02:25 AM
php software can not download larger size files xiexusheeboard Linux - Newbie 1 06-23-2008 06:48 AM
Can't resume file transfer on files larger than 1 gig dalesan Linux - Newbie 2 10-11-2005 11:50 AM

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

All times are GMT -5. The time now is 11:43 AM.

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