ID:               41561
 User updated by:  samy-delux at gmx dot de
 Reported By:      samy-delux at gmx dot de
-Status:           Feedback
+Status:           Open
 Bug Type:         PHP options/info functions
 Operating System: Ubuntu Linux
 PHP Version:      5.2.3
 New Comment:

There is no error! The limit is set to 3MB with php_admin_value. Then I
change it with ini_set() to 20MB and I can allocate 19MB (well, almost
20MB)...
When I don NOT ini_set() and leave the limit at 3MB it raises the
following error:

Fatal error: Allowed memory size of 3145728 bytes exhausted (tried to
allocate 19971501 bytes) in /var/www/iniset.php on line 11


Previous Comments:
------------------------------------------------------------------------

[2007-06-01 16:29:05] [EMAIL PROTECTED]

And the error you get..?

------------------------------------------------------------------------

[2007-06-01 15:49:30] samy-delux at gmx dot de

It does change it for real:

$foo = str_repeat('bla', 19922944);

------------------------------------------------------------------------

[2007-06-01 15:41:52] [EMAIL PROTECTED]

I don't have apache setup, so can you try and see if that actually
changes it for real? ie. something like:

$s = '';
while(1) $s.='fooooooooooooooooooooooooooooooooooooo';



------------------------------------------------------------------------

[2007-06-01 15:23:16] samy-delux at gmx dot de

Description:
------------
When I set a value inside the httpd.conf with php_admin_value or
php_admin_flag that is INI_ALL or INI_PERDIR it can be overwritten at
runtime using ini_set()

I don't think this should be possible. But the documentation on this
problem doesn't assure me if this is a bug or a feature!

Reproduce code:
---------------
/etc/apache2/httpd.conf :
php_admin_value memory_limit 3145728


iniset_test.php :
<?php

$old = ini_set("memory_limit", 20971520);

echo "old: ".$old;

$new = ini_get("memory_limit");

echo "<br>new: ".$new;

?>

Expected result:
----------------
The result is the following:
old: 3145728
new: 3145728 

Actual result:
--------------
The result is the following:
old: 3145728
new: 20971520 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41561&edit=1

Reply via email to