Environment variables in php.ini

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I have a Linux shared hosting environment with PHP running over CGI. With
CGI I can't use httpd.conf or .htaccess files for PHP related parameters,
so all the parameters should be given in one central php.ini file, AFAIK.
So how can I give parameters, in effect, like the ones below?

error_log = $HOME/php_error.log
session.referer_check = $DOMAIN_NAME
open_basedir = "$HOME:/usr/lib/php:/usr/local/lib/php:/tmp"
session.save_path = $HOME/sessions

With PHP module SAPI I would have overridden them in httpd.conf VirtualHost
directive with hard coded values. There, I don't have to use variables as
every vhost has its own VirtualHost section. But I don't know how to do it
(or if it is possible at all) in CGI mode.

Actually I did find a raw solution: Put a custom php.ini in each virtual
host's Doc_Root. But I don't really want to allow virtual hosts each
having a custom php.ini in their home directories, as that solution has
several serious drawbacks, like:
- No server/security policies can be enforced,
- An intruder can change the local php.ini and remove all the security
measures,
- Hundreds of php.ini files strewn around can easily lead to chaos,
- etc.

Is it possible at all to use environment variables in php.ini, or is there
any other solution to the problem above?

Thank you.
-- 
Abdullah Ramazanoglu
aramazan ÄT myrealbox D0T cöm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux