#41561 [Fbk->Opn]: Values set with php_admin_* in httpd.conf can be overwritten with ini_set()

From: Date: Sun, 03 Jun 2007 14:18:10 +0000
Subject: #41561 [Fbk->Opn]: Values set with php_admin_* in httpd.conf can be overwritten with ini_set()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-113304@lists.php.net to get a copy of this message
 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:

I tried it with include_path and it does work as well:

'inc.php' lies in '/var/www/test/prohibited_include' and should not be
includeable!

Reproduce code:
---------------
/etc/apache2/httpd.conf :
php_admin_value include_path "/var/www/test/allowed_include"

path.php :
<?php
ini_set("include_path", "/var/www/test/prohibited_include");
include("inc.php");
?>

Expected result:
----------------
The result is the following:
Warning: include(inc.php) [function.include]: failed to open stream: No
such file or directory in /var/www/test/path.php on line 5

Warning: include() [function.include]: Failed opening 'inc.php' for
inclusion (include_path='/var/www/test/allowed_include') in
/var/www/test/path.php on line 5

Actual result:
--------------
The result is the following:
No Error because the file gets included nicely!


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

[2007-06-02 22:48:06] sniper@php.net

Can you try with some other ini option too, so we know this is general
issue with php_admin_* directives and not just this one.

include_path is good choice. 

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

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

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

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

[2007-06-01 16:29:05] sniper@php.net

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] sniper@php.net

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';



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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/41561

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


Thread (16 messages)

« previous php.bugs (#113304) next »