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 822537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:48:50+00:00 2026-05-15T02:48:50+00:00

Does anyone have a great system, or any ideas, for doing as the title

  • 0

Does anyone have a great system, or any ideas, for doing as the title says?

I want to switch production version of web app– written in PHP and served by Apache– from release 1234 to release 1235, but before that happens, have all files already in the opcode cache (APC). Then after the switch, remove the old cache entries for files from release 1234.

As far as I can think of there are three easy ways of atomically switching from one version to the next.

  1. Have a symbolic link, for example /live, that is always the document root but is changed to point from one version to the next.
  2. Similarly, have a directory /live that is always the document root, but use

    mv live oldversion && mv newversion live

    to switch to new version.

  3. Edit apache configuration to change the document root to newversion, then restart apache.

I think it is preferable not to have to do 3, but I can’t think of anyway to precompile all php files AND use 1 or 2 to switch release.

So can someone either convince me its okay to rely on option 3, or tell me how to work with 1 or 2, or reveal some other option I am not thinking of?

  • 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-15T02:48:51+00:00Added an answer on May 15, 2026 at 2:48 am

    Exactly why do you want to do this?

    When I switch to a new release, I just stop my Apache, replace the PHP files on the server via checkout from my VCS and restart Apache. It mostly takes less than 30 seconds to pull this off, it’s even scriptable. All that is executed at a time when there are few or no users. After that, the opcode cache is empty and will fill itself as soon as someone uses the files.

    Maybe the first few hits will not have optimal performance but that should not be so bad. On my production systems no one ever noticed this short performance drop. And there are some really heavy load systems among them.

    You can even place a simple “upgrading … be back soon” screen on your server while replacing the files to avoid any disturbing error messages to your users.

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

Sidebar

Related Questions

No related questions found

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.