| Bug #7836 | memory_limit ignored | ||||
|---|---|---|---|---|---|
| Submitted: | 15 Nov 2000 10:11pm UTC | Modified: | 18 Nov 2000 9:40am UTC | ||
| From: | mail-php at kimihia dot org dot nz | Assigned to: | jmoore | ||
| Status: | Closed | Category: | Documentation problem | ||
| Version: | 4.0.3pl1 | OS: | Linux 2.2.15-4mdk | ||
[16 Nov 2000 5:30am UTC] hholzgra@php.net
how does your configure line look like? have you used '--enable-memory-limit' ? it is _not_ enabled by default!
[16 Nov 2000 7:13am 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
[17 Nov 2000 11:21am 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
[18 Nov 2000 9:40am 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

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