Your SlideShare is downloading. ×
Options for deploying PHP applications
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Options for deploying PHP applications


Published on

For many PHP shops, moving code from development to production sounds like it should be easy, and it can be. The problem is that sometimes deployment strategies can result in longer downtime than is …

For many PHP shops, moving code from development to production sounds like it should be easy, and it can be. The problem is that sometimes deployment strategies can result in longer downtime than is desired, rollbacks can be difficult or there can even be uncertainty on what is actually in the production environment.

Watch the webinar at and read the blog posts at

Published in: Technology
1 Comment
  • You may want to check out our deploydo ( It takes care of the whole process and even shows you line-by-line comparisons when updating code. The goal is to make it very easy for the developers and sysadmins so that they can focus on their actual work :-)
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. Guidelines for deploying PHP applications
    By Kevin Schroeder
    Technology Evangelist
    Zend Technologies
  • 2. About me
    Kevin Schroeder
    Technology Evangelist for Zend
    Sys Admin
    IBM i Programmer’s Guide to PHP
    You want to do WHAT with PHP?
    Coming up
    Race Ferraris on the weekend
    My Honda has a dismal win record
  • 3. If you have a question you can
    Type in the Q&A panel
    Follow us!
    Zend Technologies (me!)
  • 4. Agenda
    What we will be talking about
    Rsync/SVN/PEAR/yum mechanisms
    What we will not be talking about
    Build tools (Phing, Maven, etc.)
    Database versioning/deployment
    Continuous Integration
    MSI installs (Sorry MS folks, I really wanted to but, y’know, time)
    Test-Driven Development
  • 5. Application Stages
    | 5
    Increasing Maturity of PHP Applications
  • 6. Maturity
    | 6
    Increasing Maturity of PHP Applications
    Testing & Validating Environment
    Testing & Validating Application
    Distinct Dev Environments
    Where are you?
  • 7. Development
    To provide developers an environment to write their code
    Should be similar to production, though it usually isn’t
    Often more open security
    Usually local to the developer, though not required
  • 8. Testing
    To provide a non-programming environment to test functionality
    Continuous Integration could be included
    Generally no development occurs, only testing
    Developers should not do the testing, if possible
    Restricted outbound networking
    Use Zend Server Monitoring and Code Tracing to help reproduce errors
  • 9. Prepared for and handed off to System Administrators
    (the stuff we’re here to talk about)
  • 10. Staging
    To test your deployment process/scripting (not your code)
    Developers generally do not have access, unless they are also the sysadmin
    Very restricted outbound networking
    Mirrors production as best as possible
  • 11. Change Control
    A formal process used to ensure that changes are introduced in a controlled and coordinated manner
    Protect against unnecessary changes introduced to a system without forethought
    Requires documenting the release process
    Software version number
    Plans for rollback (tested? y/n)
    Expected outage time
    Customer impact
    Done prior to doing anything in production
  • 12. Pre-Production (Optional)
    Test the code in the production environment without impacting customers
    Not likely to have use in the cloud or large scale deployments
    Deployed in production immediately prior to making it live
    Test the application with production settings without customer interaction
  • 13. Production
    • Purpose
    • 14. Do whatever it is that it’s supposed to be doing
    • 15. Characteristics
    • 16. Developers do not have access (as they might be tempted to fix something)
    Deployment should be done without requiring developer input
    • Very limited inbound traffic – generally only the service that is being served. i.e. HTTP
  • Application considerations
    Build the application to be aware of different environments
    Zend_Config_* is good at this
    Do not set the environment type in your code
    Environment variables can be placed in server config
    It means that you won’t accidentally keep your development settings turned on in production
    Make production your default environment
    Keeps accidental data leakage to a minimum
  • 17. Deployment Option 1 – rsync
    Already installed on your system
    No deployment script can be run
    Not integrated with either PHP or the OS
    Rollbacks require rolling back the entire source server
    Does not understand versioning
    One option is to move the source tree prior to the rsync
    Uses xinetd
  • 18. Deployment Option 2 – Source Control
    You should already be using source control
    Has versioning
    Can have pre/post install scripts
    Easy to do automatic deployments
    Do you want to put details on how to access your source code on your production box?
    Requires that your source control is accessible from production
    Deny access to .svn directories
  • 19. Deployment Option 3 – PEAR
    Designed for PHP
    Very scriptable
    Natural for doing things like clearing a cache
    Has a better understanding of PHP
    Cross platform compatible
    Requires admins to be familiar with PHP code
    Limited to PHP deployment
    Available tooling is restrictive/build your own package.xml
  • 20. Deployment Option 4 - OS-based
    Easily added as part of your server deployment
    Very cloud friendly
    Admins already know how to use it
    Can describe OS-requirements
    Downtime limited to actual install, not network transfer time
    Depends on environment
    Any PHP deployment scripting needs to be deployed with the application and executed in %post hook
    E.g. Invalidating the cache
  • 21. Which should you use?
    Need something simple? rsync
    Need to deploy to multiple disparate platforms? PEAR
    Need to deploy internally/with minimal developer input?OS (yum/apt)
    If using the OS consider maintaining an internal “blessed” repository instead of depending on the distribution
  • 22. Continuous Deployment
    Using automated deployment
    Very tight end-to-end integration
    Requires a lot of trust that the developers have a fully tested application w/ backend and frontend code
    Probably more work to manage if you can count the servers in your production environment with your fingers
    Could be beneficial but make sure you know what you’re doing
    You will need to have several testing experts
  • 23. Takeaways
    No need for copy-and-paste deployment
    No need for (S)FTP
    Have an easy rollback mechanism
    Prepare for errors in deployment
    Try to minimize the amount of scripting needed for deployment
    Consider using VMs on anything important to keep downtime to zero
  • 24. If you have a question you can
    Type in the Q&A panel
    Follow us!
    Zend Technologies (me!)
  • 25. Get this information and all the examples at… once I’ve written it