php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18502 define user variable through httpd.conf
Submitted: 2002-07-23 13:08 UTC Modified: 2002-07-23 13:12 UTC
From: pierre dot baudracco at aliacom dot fr Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.2.1 OS: Linux
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: pierre dot baudracco at aliacom dot fr
New email:
PHP Version: OS:

 

 [2002-07-23 13:08 UTC] pierre dot baudracco at aliacom dot fr
I would like to define php variable in httpd.conf.

I have a PHP app (OBM) which includes many files and so use
the php.ini include_path var.
eg: include("obminclude/global.inc");
Now i would like to install more than one occurence of OBM on one server, but with different obm version.
I think of changing the "obminclude" to a variable $obminclude.
But where to define this var ? not in the php files (too many) and i would prefer a single location.
It can't be in an included file as it defines the include path.

So in the virtual host of the obm instance would be cool.
But we didn't succeed in this as ini_get(var) doesn't
return the var and get_cfg_var(var) returns the value found in php.ini and not the httpd.conf modified one.

So could this feature be added ? or is there an other way to pass variable ?

auto prepend a one line file consisting of $obminclude=...
doesn't really satisfies me.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-23 13:11 UTC] derick@php.net
Have a look at http://httpd.apache.org/docs/env.html ; it explains how you can do this with environment variables. In PHP you can then use getenv() to read the value.

Derick
 [2002-07-23 13:12 UTC] sniper@php.net
Use the SetEnv directive, e.g.

SetEnv SPECIAL_PATH /foo/bin

This will be hold in $_SERVER['SPECIAL_PATH']

 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Fri Jun 26 14:00:01 2026 UTC