Re: How to pass an environment variable to php-cgi (cgi-fcgi)?

Meder Bakirov <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Organization Transfer Ltd.
Message-ID <[email protected]>
I wrote a simple php file, debug.php, which displays a 'PHPRC' envvar, set in 
Apache:

debug.php:
--------------
<?
echo $_ENV['PHPRC'];
echo $_SERVER['PHPRC'];
?>

and it normally displays the PATH of PHPRC, which I set in apache's 
configuration file (via SetEnv), but it seems that php-cgi doesn't take care 
of this environment variable and doesn't use a php.ini file, located in this 
PATH, it still uses the old php.ini file. 

Maybe, any magic configuration for SuEXECed php-cgi: path, permissions, other?

Thanks...

On Tuesday 21 June 2005 11:19, Meder Bakirov wrote:
> Hi all,
>
> I have a configuration like this on my server:
>
> chrooted Apache2 + SuEXEC + mod_fastcgi + php-cgi
>
> I host virtual hosts there and each virtual host have its own respective
> associated user and group. PHP as a FastCGI via SuexecWrapper runs just
> fine :), but I want each virtual host (user) to have its own php.ini file.
>
> On the fastcgi FAQ page I found a sample on how to invoke php-cgi via a
> tiny shell script, but the case is that, I do not want to provide/have a
> shell in my chrooted environment.
>
> Also, I read, that SuEXEC drops all environment variables, but predefined
> safe variables in suexec.c - I added "PHP_" and "PHPRC=" to these variables
> and re-built suexec, but anyway it seems it doesn't help :(
>
> Maybe there is a better solution? What else would you advice me to try to
> solve this problem?
>
> Thank you very much,

-- 
Best rgrds,
.coder

My Intellect is The Power! (c) The Prodigy

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQBCt8m/iHZXWv0HWscRAj7HAJ48au+gmKIOSbMAqKj+sBXG0/n+KgCgveNm
I/7LB7Ophbmkl5JDBpC94o0=
=SuG2
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.