php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #7836 memory_limit ignored
Submitted: 2000-11-15 22:11 UTC Modified: 2000-11-18 09:40 UTC
From: mail-php at kimihia dot org dot nz Assigned: jmoore (profile)
Status: Closed Package: Documentation problem
PHP Version: 4.0.3pl1 OS: Linux 2.2.15-4mdk
Private report: No CVE-ID: None
 [2000-11-15 22:11 UTC] mail-php at kimihia dot org dot nz
The resource limits section of php.ini is being ignored.

The ini file reads:

memory_limit = 6M

In a script it is possible to allocate well past this. I
succeeded in allocating over 100MB.


Sample:

$str = '';
$total = 0;

for ( $i = 0 ; $i < 65000 ; $i++ )
  $str .= 'a';

for ( $i = 0 ; $i < 1024 ; $i++ ) {
  printf(' %d (%d)', $i, $total);
  $strbuff[$i] = "$i - $str";
  flush();
  $total += strlen($strbuff[$i]);
}

# This allocates ~ 64MB

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-16 05:30 UTC] hholzgra@php.net
how does your configure line look like?

have you used '--enable-memory-limit' ?

it is _not_ enabled by default!

 [2000-11-16 07:13 UTC] hholzgra@php.net
--with-memory-limit was not enabled 

maybe this is not clear enough in the manual or 
the comments in php.ini-dist ?

moved to documentation problems
 [2000-11-17 11:21 UTC] jmoore@php.net
I find this strange that this is not enabled by default.. Is there a good reason for this?? Personally I think its somthing people assume is turned on and should be on by default. Maybe there are good reasons for it not being on by default. I will add a note in php.ini and the config options in the manual later this evening 
 [2000-11-18 09:40 UTC] jmoore@php.net
This is actually fairly clear in the manual.. It is also clear when doing ./configure --help. I added a note about default value to manual but thats about all we can do.. we cant force people to read the docus
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Oct 02 22:05:53 2022 UTC