php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40023 memory_limit configuration seems to be ignored
Submitted: 2007-01-04 16:28 UTC Modified: 2007-01-04 17:50 UTC
From: szoftos at freemail dot hu Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 5.2.0 OS: Linux 2.4.33
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: szoftos at freemail dot hu
New email:
PHP Version: OS:

 

 [2007-01-04 16:28 UTC] szoftos at freemail dot hu
Description:
------------
the memory_limit in php.ini won't be taken in use in php 5.2.0

i have set up to 8M in the configuration file, but when i get a phpinfo(), there is no memory_limit option in the configuration options.

ini_get also won't return any value, and i have experienced that in this way one script can eat up all memory, causing messages like this in the kernel log:

kernel: __alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
kernel: VM: killing process php
kernel: VM: killing process mysqld

meanwhile the whole machine hangs.

i'm using lighttpd, with fastcgi extension. php is running under the username of the virtualhost's user.

i have tested this with another virtualhost on the server, i couldn't see it on the other site too.

php compile options:

'./configure' '--enable-mbstring' '--disable-static' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-config-file-path=/etc/php5' '--enable-magic-quotes' '--enable-debugger' '--enable-track-vars' '--enable-safe-mode' '--with-regex=system' '--with-versioning' '--enable-sysvsem' '--enable-sysvshm' '--with-mod_charset' '--enable-force-cgi-redirect' '--without-mm' '--enable-trans-sid' '--with-dbase' '--with-filepro' '--enable-yp' '--enable-ftp' '--with-xml' '--with-mysql=shared,/usr' '--with-iconv' '--with-gettext' '--with-zlib=/usr' '--with-gd=shared,/usr' '--with-mysql-sock=/tmp/mysql.sock' '--enable-gd-native-ttf' '--with-png' '--with-ttf' '--with-jpeg-dir=/usr' '--with-freetype-dir=/usr' '--with-xpm-dir=/usr' '--enable-fastcgi' '--enable-cgi' '--enable-discard-path'

Reproduce code:
---------------
<?
phpinfo();

ini_get('memory_limit');
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-04 16:31 UTC] tony2001@php.net
In PHP <= 5.2.0 you need to add --enable-memory-limit to the configure line first.
In later versions memory limit will be always enabled.
 [2007-01-04 17:50 UTC] szoftos at freemail dot hu
Hello Tony,

Thanks for replying me in such a short time. I am recompiling now the php with that configuration option.

I was planning to add ulimit memory restriction to the php interpreter, but now i'll try it that way.

Thanks again,
Laszlo
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 09:01:27 2025 UTC