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

  • Home
  • SEARCH
  • 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 8904671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T02:11:34+00:00 2026-06-15T02:11:34+00:00

Obviously this is a common issue: we have PHP web applications that are managed

  • 0

Obviously this is a common issue: we have PHP web applications that are managed by git or other SCMs, and are deployed (ideally) in 3+ different environments that should be extremely similar. The only differences should be in the specific configuration such as addressing of external resources (eg: database host, memcache, etc).

Here are the three methods I’ve seen or used:

  1. Maintain an array of hostnames => environment types:
    $hosts = array ('host1.example.com' => 'production', 'staging.example.com' => 'staging' ...)
  2. Have a config file that is in the .gitignore (or equivalent for other SCMs) with an example version to copy and edit
  3. Use http.conf to set an env_var: “SetEnv ENVIRONMENT dev” in your http.conf and then $environment = get_env('ENVIRONMENT'); in your scripts.

Are there other methods as well? I know each of these have benefits and pitfalls–what are those?

  • 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-06-15T02:11:35+00:00Added an answer on June 15, 2026 at 2:11 am

    We use Jenkins to pull from git server whenever a push event is issued.

    In it’s config we have a line that is different for each server:

    mv config_<env>.php config.php
    

    while config.php is in git ignore.

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

Sidebar

Related Questions

I have a database entry that I need to update. This method obviously doesn't
I have a few different applications that share some common DLLs. At the moment
I have encountered what I expect is a common issue in web development. I
Obviously it's early days, I do not know whether this is information that is
you must have seen this piece of code somewhere else too,but obviously there's no
I have a performance issue regarding a quite simple query that run for more
I hit this issue regularly but here is an example.... I have a Order
I have a Yii web service actionQuery that queries a model based on four
Have run into an issue that i am hoping somebody can help give me
I'm trying to scrape this grid from a website: Obviously this is going to

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.