Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 3:06 AM, Arno Kuhl ak...@telkomsa.net wrote:
 I'm having some problems with the way my service provider is implementing
 FastCGI. My tests show that local configuration values are no longer used,
 even though those are the values reported by php when the script queries a
 setting (e.g. register_globals). In fact all settings done by script or in
 .htaccess are ignored, though reported to be in effect by php. I seem to
 remember seeing somewhere that local values are supposed to override master
 values but I can't find the reference right now. Can anyone please tell me
 how local vs. master values are supposed to work, or point me to a
 definitive reference.

 Cheers
 Arno



Changing register_globals in script will not have the desired effect,
since the action of registering globals will have been either
completed or skipped by the time you call ini_set(). If the host
allows it, you can override it in .htaccess, but I've not been able to
do so on the couple sites I've touched that were hosted on by a shared
hosting provider. In those cases, I WAS able to create my own php.ini
file in the web root folder and configure it as needed. Of course, if
you do that you should also configure Apache to not serve that file if
requested.

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP configuration values

2009-09-11 Thread Arno Kuhl
On Fri, Sep 11, 2009 at 3:06 AM, Arno Kuhl ak...@telkomsa.net wrote:
 I'm having some problems with the way my service provider is 
 implementing FastCGI. My tests show that local configuration values 
 are no longer used, even though those are the values reported by php 
 when the script queries a setting (e.g. register_globals).

-Original Message-
From: Andrew Ballard [mailto:aball...@gmail.com] 

Changing register_globals in script will not have the desired effect, since
the action of registering globals will have been either completed or skipped
by the time you call ini_set(). If the host allows it, you can override it
in .htaccess, but I've not been able to do so on the couple sites I've
touched that were hosted on by a shared hosting provider. In those cases, I
WAS able to create my own php.ini file in the web root folder and configure
it as needed. Of course, if you do that you should also configure Apache to
not serve that file if requested.

Andrew
--


You're right, you can't change register_globals in script but you can query
it in script, which is what I was referring to. There aren't many settings
you can change in script, about the only useful one that we use is
max_execution_time. Either way, what I find in testing is that on our host
php returns the value reported in phpinfo as the local value which is
correct, because that's the value that should be in effect (combination of
httpd.conf, php.ini, .htaccess and values set in script), but the value
that's actually in effect is the master value. 

For example, if php.ini sets register_globals on and .htaccess sets
register_globals off, then the code 

ini_get('register_globals')

reports register_globals is off (it's reporting the local value) but in fact
register_globals is on. In this particular case our app would stop with a
configuration error if it found register_globals on, but it thinks it's off
so happily carries on.

Local is supposed to override master values but they have master overriding
local values. I'm trying to confirm that local is supposed to override
master, and find a proper reference that I can show to my hosting guys. I
searched php.net but they don't mention which one takes precedence. Anyone
know of any references?

BTW Andrew, were those hosting servers that wouldn't allow override in
.htaccess running FastCGI? Maybe FastCGI doesn't allow config settings in
.htaccess but I can't find anything conclusive about that either.

Cheers
Arno


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP configuration values

2009-09-11 Thread Andrew Ballard
On Fri, Sep 11, 2009 at 10:49 AM, Arno Kuhl ak...@telkomsa.net wrote:
 You're right, you can't change register_globals in script but you can query
 it in script, which is what I was referring to. There aren't many settings
 you can change in script, about the only useful one that we use is
 max_execution_time. Either way, what I find in testing is that on our host
 php returns the value reported in phpinfo as the local value which is
 correct, because that's the value that should be in effect (combination of
 httpd.conf, php.ini, .htaccess and values set in script), but the value
 that's actually in effect is the master value.

 For example, if php.ini sets register_globals on and .htaccess sets
 register_globals off, then the code

    ini_get('register_globals')

 reports register_globals is off (it's reporting the local value) but in fact
 register_globals is on. In this particular case our app would stop with a
 configuration error if it found register_globals on, but it thinks it's off
 so happily carries on.

 Local is supposed to override master values but they have master overriding
 local values. I'm trying to confirm that local is supposed to override
 master, and find a proper reference that I can show to my hosting guys. I
 searched php.net but they don't mention which one takes precedence. Anyone
 know of any references?


For some reason, I was thinking that even values overriden in
.htaccess would be reported as master and that only values set in
ini_set() would be local, but don't hold me to that. At any rate, if
for some reason register_globals was disabled during script execution
(but was enabled at script invocation) that would mess with your code.


 BTW Andrew, were those hosting servers that wouldn't allow override in
 .htaccess running FastCGI? Maybe FastCGI doesn't allow config settings in
 .htaccess but I can't find anything conclusive about that either.

 Cheers
 Arno

I think they are using CGI, but I don't think it's a restriction on
FastCGI. I just assumed that since it was shared hosting PHP was
running inside of some sort of sandbox that allowed each site to
customize things without affecting other clients hosted on the same
box (and probably prevent scripts on one site from accessing scripts
belonging to another site on the same box). Someone with more server
administration experience than I could probably answer that.

Andrew

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php