Page 1 of 1

Error in Parsing the PHP script

Posted: Tue Feb 03, 2009 7:35 am
by urnetmate
Hi all,

I have written a script to fetch data from database. I keep all these records in PHP variable of type array().
Then I do process on each data from that array and prepare a new array of updated contents.
Then from this new array I update the database records one-by-one.

This script runs efficiently when the content array size is small or even upto 1200 keys. But not working for huge arrays.
The browser doesn't parse the script and forces the .php file to download. IE says "The page cannot be displayed".

I am using Linux, Apache 2 and PHP 4.3.9

What could be the issue:?:

Re: Error in Parsing the PHP script

Posted: Tue Feb 03, 2009 7:40 am
by mickeyunderscore
Odds are that all of the memory got used up. You will have to find a way around the memory limit, for example you could try update them in batches so you don't have to load everything into memory at once.

Re: Error in Parsing the PHP script

Posted: Tue Feb 03, 2009 7:47 am
by urnetmate
I am using unset() after every iteration and update done on original array content to free-up memory.

Re: Error in Parsing the PHP script

Posted: Tue Feb 03, 2009 7:50 am
by urnetmate
The same script efficiently works in one windows environment having PHP5 installed.... but not on Linux with PHP 4.3.9 :(

Is there any configuration issue?

Re: Error in Parsing the PHP script

Posted: Tue Feb 03, 2009 7:52 am
by mickeyunderscore
Well you could check the memory limit in php.ini. Further than that I'm not sure, I'm not familiar with differences between PHP 5 and 4.