- Don't copy files into current document root
- Let existing requests finish on old code
- New requests start on new code
- Avoid clearing your opcode cache
- Minimal impact on production traffic
- two
DOCUMENT_ROOT
directories: A & B - symlink
DOCUMENT_ROOT
toggles between them - use
realpath()
symlink at the web server level - set
DOCUMENT_ROOT
to symlinked realpath - never hardcode
DOCUMENT_ROOT
in code
- Apache: http://github.com/etsy/mod_realdoc
- nginx:
fastcgi_param DOCUMENT_ROOT $realpath_root
- Hacky PHP: https://github.com/etsy/incpath