Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:49:30+00:00 2026-05-13T08:49:30+00:00

Just putting in context to clarify the main question: On my development machine, PHP5.3.1

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:49:30+00:00Added an answer on May 13, 2026 at 8:49 am

    Ok I finally got it. On dreamhost, it is possible to use fastcgi and therefore declare environment variables with it. It consists of just adding this simple script

    #!/bin/sh
    export PHP_FCGI_CHILDREN=2
    exec /home/USERNAME/YOURDOMAIN/cgi-bin/php.cgi
    

    Which is where my compiled PHP5.3.1 was located.
    chmod 744 on that file called dispatch.fcgi which will be allowed more memory by dreamhost’s watchdog.

    After that I added to my domain’s .htaccess the following:

    Options +ExecCGI
    AddHandler fastcgi-script fcg fcgi fpl
    AddHandler php5-fastcgi .php
    Action php5-fastcgi /dispatch.fcgi
    

    now in the application’s root I have another .htaccess with:

    SetEnv APPLICATION_ENVIRONMENT staging
    

    In a php script is is retrievable via getenv(‘REDIRECT_APPLICATION_ENVIRONMENT’);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 309k
  • Answers 309k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer var xmlItem = root.SelectSingleNode("/Primary/Complex[@Name='comp1']/@Value"); May 13, 2026 at 9:57 pm
  • Editorial Team
    Editorial Team added an answer No, EM's answer is NOT the right solution. Try running… May 13, 2026 at 9:57 pm
  • Editorial Team
    Editorial Team added an answer Here is a solution: (defadvice kill-new (around my-kill-new (string &optional… May 13, 2026 at 9:57 pm

Related Questions

Here's a very simple Prototype example. All it does is, on window load, an
I'm trying to build a sequence that determines the order to destroy objects. We
I am now in the process of planning the deployment of a SharePoint solution
I always assumed that if I was using Select(x=> ...) in the context of
So I'm starting to use Ninject for dependency injection and I'm wondering what people

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.