VERY long php-script crashes
I've found some forum posts regarding this subject around the web, but nothing really seems to hit the spot. I thought I'd ask the pros.
I have a php-script. A very, VERY long php-script. It basically retrieves a bunch of info from my MySQL-db, creates a pdf (using fpdf) with the info and then outputs the pdf as a file to my server... the script does this about a 1000 times (and this number will only increase in the future).
The problem is that after about 400 rounds the browser (I'm using Chrome as a rule but the problem persist with all major browsers) returns the "No data recieved"-error and stops the script.
My logic tell me that this is either the server taking too long or the browser panicking about not getting anything back from the server.
I've tried to solve the first of my thought by adding
to the top of my script. This does not solve the problem. This leads me to believe that the problem has to do with the browser but I've absolutely no idea how to solve that.
Of relevant information I might add that my site is hosted with a third-party hosting company. Also they run PHP4 (don't worry, I'm already trying to change my host to one that runs PHP5.
What do I do about my script to make is stop crash?
Best regards and thanks in advance,