Click here to Skip to main content
15,885,216 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
GeneralRe: Linux Distribution Pin
Albert Holguin17-Nov-11 9:54
professionalAlbert Holguin17-Nov-11 9:54 
SuggestionRe: Linux Distribution Pin
Mohibur Rashid1-Dec-11 19:44
professionalMohibur Rashid1-Dec-11 19:44 
AnswerRe: Linux Distribution Pin
DigiOz Multimedia5-Dec-11 4:39
DigiOz Multimedia5-Dec-11 4:39 
GeneralRe: Linux Distribution Pin
Albert Holguin5-Dec-11 4:51
professionalAlbert Holguin5-Dec-11 4:51 
AnswerRe: Linux Distribution Pin
loctrice29-Dec-11 17:16
professionalloctrice29-Dec-11 17:16 
QuestionImport Google contacts using Authsub(Secure connection) Pin
Paresh14621-Nov-11 3:31
Paresh14621-Nov-11 3:31 
QuestionHow to debug PHP Memory Leak Pin
Logan Black30-Oct-11 14:17
Logan Black30-Oct-11 14:17 
AnswerRe: How to debug PHP Memory Leak Pin
Logan Black30-Oct-11 16:00
Logan Black30-Oct-11 16:00 
I have partially solved this problem.

I was told on another forum to add ob_flush(); to the While loop where I am echoing out my file nodes. This appears to work in part; it allows me to download a 140mb file with only 128M memory_limit directive set in php.ini

However, when I attempt to download a 250mb file the error is thrown again:

[31-Oct-2011 11:46:01] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 132392961 bytes) in /root/htdocs/file_manager/file_manager_download.php on line 125
[31-Oct-2011 11:46:01] PHP Stack trace:
[31-Oct-2011 11:46:01] PHP   1. {main}() /root/htdocs/file_manager/file_manager_download.php:0
[31-Oct-2011 11:46:01] PHP   2. ob_flush() /root/htdocs/file_manager/file_manager_download.php:125


As you can see, it is getting within 2mb of the limit and then failing, and I can actually see it streaming the file to the browser, it gets to about 200mb of the 250mb file, and fails.

The while loop looks like:

PHP
while ($row_GetFileDataBlobs = mysql_fetch_array($result_GetFileDataBlobs)) {
	echo $row_GetFileDataBlobs["FileData"];
	ob_flush();
}


so it appears to be working better than before, but that REALLY large files dont work.

The question is then, do I need to increase my memory_limit directive, or should it be streaming effectively with the limit of 128M but I still have a problem with my code and the way it is, or is not, trashing the memory it doesn't need.

Cheers

Mick
AnswerRESOLVED: How to debug PHP Memory Leak Pin
Logan Black30-Oct-11 17:10
Logan Black30-Oct-11 17:10 
GeneralRe: RESOLVED: How to debug PHP Memory Leak Pin
Mohibur Rashid31-Oct-11 18:01
professionalMohibur Rashid31-Oct-11 18:01 
QuestionProblem receiving arabic emails Pin
Jassim Rahma27-Oct-11 7:38
Jassim Rahma27-Oct-11 7:38 
AnswerRe: Problem receiving arabic emails PinPopular
Graham Breach27-Oct-11 9:26
Graham Breach27-Oct-11 9:26 
QuestionHow to make a Cloud text from database Pin
Jassim Rahma26-Oct-11 10:58
Jassim Rahma26-Oct-11 10:58 
AnswerRe: How to make a Cloud text from database Pin
User 171649226-Oct-11 11:39
professionalUser 171649226-Oct-11 11:39 
QuestionFacebook-Like modal box Pin
Jassim Rahma25-Oct-11 6:26
Jassim Rahma25-Oct-11 6:26 
AnswerRe: Facebook-Like modal box Pin
Mohibur Rashid25-Oct-11 15:40
professionalMohibur Rashid25-Oct-11 15:40 
Questionsignature_invalid in Google API Pin
Paresh146225-Oct-11 2:36
Paresh146225-Oct-11 2:36 
AnswerRe: signature_invalid in Google API Pin
Niall Barr26-Oct-11 3:21
professionalNiall Barr26-Oct-11 3:21 
Questiondata was not displayed in the application in the correct format. Pin
Honeyboy_2025-Oct-11 1:01
Honeyboy_2025-Oct-11 1:01 
AnswerRe: data was not displayed in the application in the correct format. Pin
cjoki4-Nov-11 10:30
cjoki4-Nov-11 10:30 
QuestionBest Practices - mysql calls Pin
Dwayner7920-Oct-11 13:59
Dwayner7920-Oct-11 13:59 
AnswerRe: Best Practices - mysql calls Pin
Mohibur Rashid21-Oct-11 0:02
professionalMohibur Rashid21-Oct-11 0:02 
GeneralRe: Best Practices - mysql calls Pin
Dwayner7923-Oct-11 7:40
Dwayner7923-Oct-11 7:40 
GeneralRe: Best Practices - mysql calls Pin
Mohibur Rashid23-Oct-11 12:05
professionalMohibur Rashid23-Oct-11 12:05 
QuestionUsing MSSQL stored procedure with codeigniter Pin
noadek20-Oct-11 6:43
noadek20-Oct-11 6:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.