On Mon, 22 Mar 2004 14:48:38 -0500, "Chung Leong" <ch***********@hotmail.com>
wrote:
Uzytkownik "go-tard" <go*****@yahoo.ca> napisal w wiadomosci
news:2e**************************@posting.google. com...
I'm wondering if there's a way to pass a value from apache to php
through httpd.conf. I've noticed that php settings can be changed
using php_value. Is there a way to send a value that is not one of the
settings to php in this way? Something like:
php_value my_dogs_name "sparky"
Then $my_dogs_name becomes globally accessible to all scripts on the
server. Specifically, I'd like to keep the name of the mysql db name
in the portion of httpd.conf associated with the virtual server that
uses it. I don't think I can use any of the php_value mysql.* settings
because I'm using PEAR DB. Any ideas? Thanks!
See http://www.phpfreaks.com/apache_manu...d/mod_env.html
The value set would be in the $_ENV array.
Actually, having just tried it, it ends up in the $_SERVER array.
Possibly because it only adds it to the environment for CGI scripts and not
modules (which run inside the Apache process rather than as a subprocess). But
there appears to be some mechanism in place that passes values from SetEnv to
$_SERVER when running PHP as an Apache module.
--
Andy Hassall <an**@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk /
http://www.andyhsoftware.co.uk/space