Professional Web Applications Themes

Allowed memory size of 8388608 bytes exhausted - PHP Development

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 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 ...

  1. #1

    Default Allowed memory size of 8388608 bytes exhausted

    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

    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).
    Paul Guest

  2. #2

    Default Re: Allowed memory size of 8388608 bytes exhausted


    "Paul" <Paul.Suetelus.com> wrote in message
    news:8757b529.0309120929.41b47557posting.google.c om...
    > 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
    >
    > 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...


    Randell D. Guest

  3. #3

    Default Re: Allowed memory size of 8388608 bytes exhausted

    In article <6Lr8b.942075$ro6.18730922news2.calgary.shaw.ca >,
    Randell D. <you.can.email.me.at.randelld> wrote:
    >
    >"Paul" <Paul.Suetelus.com> wrote in message
    >news:8757b529.0309120929.41b47557posting.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
    Billy.Harvey@thrillseeker.net Guest

  4. #4

    Default Re: Allowed memory size of 8388608 bytes exhausted

    Paul wrote:
    > As suggested, here's some code snippet:
    >
    > 25 function insert_file($galleryId,$name,$description,$filenam e, $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
    > --------
    > [email]Billy.Harveythrillseeker.net[/email] wrote in message news:<7taa31-aq.ln1kudzu.thrillseeker.net>...
    >
    >>In article <6Lr8b.942075$ro6.18730922news2.calgary.shaw.ca >,
    >>Randell D. <you.can.email.me.at.randelld> wrote:
    >>
    >>>"Paul" <Paul.Suetelus.com> wrote in message
    >>>news:8757b529.0309120929.41b47557posting.googl e.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

    MeerKat Guest

  5. #5

    Default Re: Allowed memory size of 8388608 bytes exhausted

    As suggested, here's some code snippet:

    25 function insert_file($galleryId,$name,$description,$filenam e, $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
    --------
    [email]Billy.Harveythrillseeker.net[/email] wrote in message news:<7taa31-aq.ln1kudzu.thrillseeker.net>...
    > In article <6Lr8b.942075$ro6.18730922news2.calgary.shaw.ca >,
    > Randell D. <you.can.email.me.at.randelld> wrote:
    > >
    > >"Paul" <Paul.Suetelus.com> wrote in message
    > >news:8757b529.0309120929.41b47557posting.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
    Paul Guest

  6. #6

    Default Re: Allowed memory size of 8388608 bytes exhausted

    Yes!! Changing the call to use md5_file seemed to do the trick.

    Thanks very much!

    Paul
    -----
    MeerKat <liquidlaughter2000blueyonder.co.uk> wrote in message news:<UNT9b.4040$z11.2769news-binary.blueyonder.co.uk>...
    > Paul wrote:
    >
    > > As suggested, here's some code snippet:
    > >
    > > 25 function insert_file($galleryId,$name,$description,$filenam e, $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
    > > --------
    > > [email]Billy.Harveythrillseeker.net[/email] wrote in message news:<7taa31-aq.ln1kudzu.thrillseeker.net>...
    > >
    > >>In article <6Lr8b.942075$ro6.18730922news2.calgary.shaw.ca >,
    > >>Randell D. <you.can.email.me.at.randelld> wrote:
    > >>
    > >>>"Paul" <Paul.Suetelus.com> wrote in message
    > >>>news:8757b529.0309120929.41b47557posting.googl e.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
    Paul Guest

Similar Threads

  1. #39640 [NEW]: Segfault with "Allowed memory size exhausted"
    By phpbugs at thequod dot de in forum PHP Bugs
    Replies: 7
    Last Post: December 1st, 01:55 PM
  2. #26356 [Fbk->Csd]: sporatic "Allowed memory size exhausted" errors
    By my-junkmail at earthlink dot net in forum PHP Development
    Replies: 0
    Last Post: November 22nd, 04:59 AM
  3. #26356 [Opn->Fbk]: sporatic "Allowed memory size exhausted" errors
    By sniper@php.net in forum PHP Development
    Replies: 0
    Last Post: November 22nd, 03:07 AM
  4. #26356 [Opn]: sporatic "Allowed memory size exhausted" errors
    By my-junkmail at earthlink dot net in forum PHP Development
    Replies: 0
    Last Post: November 22nd, 12:51 AM
  5. [PHP] Allowed mem size exhausted
    By Curt Zirzow in forum PHP Development
    Replies: 1
    Last Post: August 6th, 12:31 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139