Timeout while creating zipfile for download

Guys,

A zip file should be automatically created and streamed out for download.
During the creation of the zipfile (using the code http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_21355306.html)
the browser times out.

using either in the script
set_time_limit (0);
or
ini_set("max_execution_time", 0);

with 0 or a really large number does not fix the problem.

What's the hint?

Best,
jp
SWB-ConsultingAsked:
Who is Participating?
 
ljw87505Connect With a Mentor Commented:
If you have control of the server environment, I would change the max_execution_time in the php.ini, restart apache, and see if you still have the problem.  If you don't have the problem anymore, something is going wrong with the set_time_limit call (I don't think you can use ini_set for max_execution_time, can you?).
0
 
ljw87505Commented:
jp,

Most web servers have their own time limit that will override PHP's time limit.  In apache it's called "Timeout" in the httpd.conf.  Do you know what that is set to?

Hope this helps
0
 
SWB-ConsultingAuthor Commented:
sure,

it's set to 300 (I assume that's in seconds?) on the server. Actually the session timeouts after about 30 seconds.

Apache 1.3 on linux, php 4.3.4 ...

Greets,
jp
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
PromethylCommented:
Zipping with gzip? or zip? I wonder... Does it say max execution time hit as an error, or does the screen go blank?
0
 
SWB-ConsultingAuthor Commented:
Hi guys,

@prmethyl:
a zip file. The php code that generates the zip file is linked within the initial question. it does everything within php, no shell commands are executed.

@ljw87505
I have increased max_execution_time to 12hrs and it does not help.

Any other ideas?

If this problem is not solvable on this way, I change the page to create the zip, store it at a certain path and show a download link to the user (actually I preferre to stream it directly to the user). How would I "entertain" the browser while creating the zip?
(If I stream the file to the user directly (without sending a download link) I can't send out anything to the browser, because the header is updated with the filesize, after the zip file is created. )

Thanks,
jp
0
 
SWB-ConsultingAuthor Commented:
Finally I figured out, that the mem limitation caused the problem. The zip file was simply to large to be kept in mem....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.