| 
	
 | 
 Posted by Rik Wasmus on 09/12/07 16:04 
On Wed, 12 Sep 2007 17:57:57 +0200, Jim Carlock <anonymous@127.0.0.1>   
wrote: 
 
> I'm filling a really large array. Is there a way to get by 
> this error message without editing the php.ini? The array 
> needs to get built once, then looped through to fill a data- 
> base, and it will get alot bigger than 1.5MB, I'm going to 
> guess maybe at least 100MB. 
> 
> <snip> 
> 
> [12-Sep-2007 11:41:53] PHP Fatal error:  Allowed memory size 
> of 16777216 bytes exhausted (tried to allocate 10 bytes) in... 
> ... on line 23687 
> 
> </snip> 
 
http://www.php.net/manual/en/ini.core.php#ini.memory-limit 
 
So, normally this would be perfectly changable in the script itself, in a   
..htaccess or httpd.conf (for Apache), etc. 
 
> The other thing I was thinking of involves using a function 
> that gets supplied an index and returns only 20 or 50 items 
> at a time. 
 
I'd look into possible solutions not even building your array, but a   
straight insert (or update!) into the database. It depends on the actual   
code/purpose though. 
 
--  
Rik Wasmus
 
  
Navigation:
[Reply to this message] 
 |