I'm using TikiWiki and was using its file upload feature, trying to
upload a 2MB file. I get this error:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 1677706 bytes) in
/var/html/www/tiki/lib/filegals/filegallib.php on line 30
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 40 bytes) in Unknown on line 0
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 134 bytes) in Unknown on line 0
My settings are:
PHP Version 4.2.2
Apache/2.0.40 (Red Hat Linux)
memory_limit 8M
post_max_size 8M
upload_max_filesize 5M
upload_tmp_dir no value
(the machine has 512 MB RAM)
No one else is using this server, and that was the only thing I was
trying to do (i.e. upload a 2MB file).
I don't know if I can help - but someone might if you supply some code
around line 30 in your script
/var/html/www/tiki/lib/filegals/filegallib.php on line 30
Perhaps your script is caught in some loop and is eating resources...
>I don't know if I can help - but someone might if you supply some code
>around line 30 in your script
>/var/html/www/tiki/lib/filegals/filegallib.php on line 30
>
>Perhaps your script is caught in some loop and is eating resources...
I was getting this error recently (yesterday) when attempting to write an
empty string to a file using fwrite. The loop the write was in would
not terminate and the file being written to would keep growing.
Billy
25 function insert_file($galleryId,$name,$description,$filename, $data,
$size,$type ,$user,$path)
26 {
27 global $fgal_use_db, $fgal_use_dir;
28 $name = addslashes(strip_tags($name));
29 if ($fgal_use_db == 'n') {
30 $checksum = md5(implode('',file($fgal_use_dir.$path)));
31 } else {
32 $checksum = md5($data);
33 }
Line 30 seems harmless enough ... just 2 calls to standard PHP
functions...
Ideas anyone?
Paul
--------
Billy....@thrillseeker.net wrote in message news:<7taa31...@kudzu.thrillseeker.net>...
> As suggested, here's some code snippet:
>
> 25 function insert_file($galleryId,$name,$description,$filename, $data,
> $size,$type ,$user,$path)
> 26 {
> 27 global $fgal_use_db, $fgal_use_dir;
> 28 $name = addslashes(strip_tags($name));
> 29 if ($fgal_use_db == 'n') {
> 30 $checksum = md5(implode('',file($fgal_use_dir.$path)));
> 31 } else {
> 32 $checksum = md5($data);
> 33 }
>
> Line 30 seems harmless enough ... just 2 calls to standard PHP
> functions...
on line 30, would:
$checksum = md5_file($fgal_use_dir.$path);
do a better job? And similar for 32:
$checksum = md5_file($data);
Just a thought...
> Ideas anyone?
>
> Paul
> --------
> Billy....@thrillseeker.net wrote in message news:<7taa31...@kudzu.thrillseeker.net>...
>
>>In article <6Lr8b.942075$ro6.18...@news2.calgary.shaw.ca>,
>>Randell D. <you.can.email....@yahoo.com> wrote:
>>
>>>"Paul" <Paul...@telus.com> wrote in message
>>>news:8757b529.03091...@posting.google.com...
>>>
>>>>Hi,
>>>>
>>>>I'm using TikiWiki and was using its file upload feature, trying to
>>>>upload a 2MB file. I get this error:
>>>>
>>>>Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
>>>>allocate 1677706 bytes) in
>>>>/var/html/www/tiki/lib/filegals/filegallib.php on line 30
>>
>>
>>
>>>I don't know if I can help - but someone might if you supply some code
>>>around line 30 in your script
>>>/var/html/www/tiki/lib/filegals/filegallib.php on line 30
>>>
>>>Perhaps your script is caught in some loop and is eating resources...
>>
>>I was getting this error recently (yesterday) when attempting to write an
>>empty string to a file using fwrite. The loop the write was in would
>>not terminate and the file being written to would keep growing.
>>
>>Billy
--
MeerKat
Thanks very much!
Paul
-----
MeerKat <liquidlau...@blueyonder.co.uk> wrote in message news:<UNT9b.4040$z11....@news-binary.blueyonder.co.uk>...