Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
09-10-2013, 01:09 PM #1
- Join Date
- Sep 2004
- Thanked 0 Times in 0 Posts
Blank page returned for large script
I'm scraping content from a page and its sub pages and placing it into an XML file. I use PHP Simple HTML DOM Parser (http://simplehtmldom.sourceforge.net/) to do this, and it works very well.
The problem I'm having is that sometimes it works fine (after taking around 20-30 seconds), but other times it just returns a blank screen. So its clear that the script works, but sometimes it seems to just time out. I have tried removing the memory limit to stop the page timing out:
09-10-2013, 01:38 PM #2
- Join Date
- Sep 2010
- Thanked 273 Times in 273 Posts
The timeout and memory limit will be separate issues.
Upload a page with this on it, and access it.
It will tell you about time and memory limitations. To get around the time limitation separate the task into two parts with different scripts.PHP Code:
Welcome to http://www.myphotowizard.net
where you can edit images, make a photo calendar, add text to images, and do much more.
When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.
09-10-2013, 04:57 PM #3
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Even better, check your error logs. White pages indicate either no print or an error condition without enabled reporting. The error logs will still have these, so if you check them out than it should tell you a cause.
Assuming web based run, the default configuration for the time limit is 30 seconds. Once it hits that, it will issue a fatal error. Memory limit won't stop the timeout, it will control the maximum amount of memory available for PHP. Only adjust this if you require more memory. The defaults are: < 5.2.0 8MB, 5.2.0 16MB and > 5.2.0 128MB. 8MB is sufficient for most operations including DOM with a page scrape. If you have 8MB+ XML file, than you'd need to adjust. The 128MB is a tremendous amount.
Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)PHP Code:
header('HTTP/1.1 420 Enhance Your Calm');