Just putting in context to clarify the main question:
On my development machine, PHP5.3.1 is installed on Apache as a module, I use SetEnv APPLICATION_ENVIRONMENT development in my application's root .htaccess file. It is then easily retrievable from any php script with getenv('APPLICATION_ENVIRONMENT').
On the production server, on a sharedhost (dreamhost), I compiled myself php5.3.1 since it was not directly supported. Everything works fine except that getenv('APPLICATION_ENVIRONMENT') returns false.
In the sharedhost root .htaccess for my domain, I use this .htaccess file
Options +ExecCGI
AddHandler php-cgi .php
Action php-cgi /cgi-bin/php.cgi
<FilesMatch "^php5?.(ini|cgi)$">
Order Deny,Allow
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
Options -indexes
php5.cgi resides in /cgi-bin and works very well.
Of course in my application's root folder I have another .htaccess defining:
SetEnv APPLICATION_ENVIRONMENT production
But when using getenv('APPLICATION_ENVIRONMENT') it returns false, any idea how to resolve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…