Reply to Re: [PHP] Sessions memory allocation problem

Your name:

Reply:


Posted by Richard Lynch on 01/31/05 05:00

adrian zaharia wrote:
> Hi,
>
> I am testing the following code that pushes a file to the browser
> (Apache 1.3 + PHP 4.3.8 but tested also under several other configs)
>
> Try it with a BIG test1.zip (e.g. 100M in size)
>
> <?php
> ignore_user_abort();
> set_time_limit(0);
>
> session_save_path('/tmp');
> session_start();
>
> $sFileName = 'test1.zip';
> $sFileDir = '/var/www/html/';
>
> header("Content-Type: application/octet-stream");
> header("Content-Disposition: attachment;filename=\"" . $sFileName . "\"");
> header("Content-Length: " . filesize($sFileDir . $sFileName));
> header('Pragma: cache');
> header('Cache-Control: public, must-revalidate, max-age=0');
> header('Connection: close');
> header('Expires: ' . date('r', time()+60*60));
> header('Last-Modified: ' . date('r', time()));
>
> $oFp = fopen($sFileDir . $sFileName, "rb");
> $iReadBufferSize = 512;
> while (!feof($oFp)) {
> echo fread ($oFp, $iReadBufferSize);
> }
> fclose ($oFp);
> exit;
>
> ?>
>
> What i discovered is that if i keep the 2 session initialisation functions
> the script will work ONLY if the allocated memory is greater than the size
> of the tested file. If i remove the session functions the script works
> fine
> even if the test1.zip file is very big (hundreds of Megs)
>
> Is it something i do wrong? Or is a bug and i should report it?
>
> I mention that I NEED the 2 functions so removing them is not THE
> solution.
> Nor setting in php.ini a huge memory limit :(

This naive reader would suggest filing a bug report...

At least, *I* don't think it should behave this way.

http://bugs.php.net

--
Like Music?
http://l-i-e.com/artists.htm

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация