php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37831 --enable-memory-limit doesn't work under apache2
Submitted: 2006-06-17 03:32 UTC Modified: 2006-06-17 10:37 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: joe at estara dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.1.4 OS: linux 2.6.16
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joe at estara dot com
New email:
PHP Version: OS:

 

 [2006-06-17 03:32 UTC] joe at estara dot com
Description:
------------
Using php 5.1.4, --enable-memory-limit appears to have no effect. 

e.g.  php -i: shows I have it set:
memory_limit => 1M => 1M

Configure shows it's in there 

Configure Command =>  './configure' ... '--enable-memory-limit'

Here's the whole thing:
Configure Command =>  './configure' '--prefix=/prod/apache/php' '--with-apxs2=/p
rod/apache/bin/apxs' '--with-openssl' '--with-mysql=/prod/mysql' '--with-zlib' '
--without-pear' '--with-gd' '--with-ttf' '--enable-gd-native-ttf' '--with-freety
pe-dir=/usr' '--with-mcrypt' '--with-imagick=shared' '--with-pfpro=shared,/prod/
pfpro/' '--enable-sockets' '--with-curl' '--enable-mbstring=all' '--without-sqli
te' '--without-pdo-sqlite' '--with-jpeg-dir=/usr/' '--with-png-dir=/usr/' '--wit
h-libdir=lib64' '--enable-memory-limit' '--enable-sysvshm'


Reproduce code:
---------------
<?php
for($i=0;$i<400; $i++) 
  ${'test' . $i}  = file_get_contents("/etc/termcap"); 
?>

Expected result:
----------------
I'd expect it to hit my 1M limit and error out. 

Actual result:
--------------
It uses all available ram on the machine and dies.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-17 03:41 UTC] joe at estara dot com
Works from the CLI

$ php test.php

PHP Fatal error:  Allowed memory size of 1048576 bytes exhausted (tried to allocate 804614 bytes) in test.php on line 5

Must be something with apache?
 [2006-06-17 04:05 UTC] joe at estara dot com
rebuilt and it's fixed
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Mar 30 11:01:25 2020 UTC