Your SlideShare is downloading. ×
0
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
Options for deploying PHP applications
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

10,932

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 http://www.zend.com/webinar/Server/70170000000bHsS-webinar-guidelines-for-deploying-php-applications-20100617.flv and read the blog posts at http://www.eschrade.com/search/tag/id/deployment.

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
  • You may want to check out our deploydo (http://www.deploy.do). 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 :-)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
10,932
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
74
Comments
1
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×