php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15258 memory_limit does not work
Submitted: 2002-01-28 14:44 UTC Modified: 2002-01-28 17:22 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hs at cybertec dot at Assigned:
Status: Not a bug Package: *Graphics related
PHP Version: 4.1.0 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hs at cybertec dot at
New email:
PHP Version: OS:

 

 [2002-01-28 14:44 UTC] hs at cybertec dot at
I am working with dynamic images and I have encountered the following problem:

<?php
        include("image.php");
 
        $image = genimage(2000000, 20000000);
        print "it worked";
 
?>


function genimage($xsize, $ysize)
{
        $image = ImageCreate($xsize, $ysize);
        if      (!$image)
                die("cannot create image<br>\n");
 
        # painting background
        $white = ImageColorAllocate($image, 255, 255, 255);
        ImageFill($image, 1, 1, $white);
 
        return $image;
}

When I am running the script Apache will allocate a lot of memory even if memory_limit in php.ini is set to 8 megabytes of RAM. I guess that this is a bug because PHP does not seem to check for memory violation before allocating the memory needed by the pic.
Is there a way to solve the bug or at least to get around it. Maybe the problem has to do with GD (PHP cannot check before allocating). If it is this way this should be documented.

Thanks for your work,
    Hans

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 17:22 UTC] yohgaki@php.net
Works for me.
--enable-memory-limit is missing when you configure.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 13 12:01:28 2024 UTC