Deploying PHP Applications cover page

Deploying PHP Applications

Deploying PHP Applications

It should not be difficult, scary or time consuming to deploy your application. This book will discuss goals for your deploy process and how you can achieve them. We'll take a look at various tools available to make this easier.
Deploying PHP Applications Edit
This book is 50% complete


About the Book

The world for developers is becoming more and more agile. This increases the importance of having a great deploy process. Being able to adapt and react fast to changes is the way to stay agile. With a slow or complicated deploy process it becomes impossible to stay agile. You want to be able to respond fast to feedback and iterate with a fast and easy deploy (or rollback). That is the agile way.

A deploy is an important part of the software  development process. Somehow it has been forgotten a bit in the PHP community. I hope to share my thoughts and experiences in this book to aid you in optimizing your deploy process. "Software rot" is something that happens to code if it's not maintained in a proper way. When it comes to deploy I call it "shipping rot". Let's try to stay away from that and treat our deploy process as any other important part of our applications.

You might be a developer. You might be the manager of or product owner to a team of developers. You will benefit from this whomever you might be. Whether you want to optimize the deploy process for technical or management reasons doesn't matter. 

The style of the book will not be in the form of that you need to read the entire thing from start to finish. You could pick the areas where your process is suffering and focus on that. There will be both theory and technical implementation of the concepts.

This book is fully open source, you can find everything in the github repository:

Read more

Table of Contents

  • Introduction
    • Background
    • Who it’s for
    • Outside its scope
    • Assumptions
    • About the author
    • Code samples
    • Thanks to
  • 1. Automate, automate, automate
    • One button to rule them all
    • Example of a manual step
    • Time is always a factor
  • 2. Goals
    • How it usually begins
    • Maturity
    • Agility
    • Plan for a marathon
    • Release cycles
    • Technical debt and rot
    • The list
  • 3. Environments
    • Repeatable
    • Configuration / environment variables
    • Local environment
    • Development environment
    • Staging environment
    • Production environment
    • Testing environment(s)
    • Simplify server access
  • 4. Atomic deploys
    • What is atomicity?
    • Achieving atomicity
  • 5. Tools
    • Git hooks
    • Phing
    • Capistrano
    • Rocketeer
  • 6. Version control
    • Git-flow
  • 7. Dependencies
    • Semantic Versioning
    • Version control
    • Development dependencies
    • The composer.lock file
    • Composer and github rate limit
  • 8. Database migrations
    • Installation & configuration
    • Migration files
    • Possible data loss on rollbacks
    • Batches

Read More

About the Author

About the Contributors


Jenny Modess

Proof reader

Keeping spelling, grammar and storytelling in check!

Read more


Joakim Unge

Cover designer

Check out his portfolio at!

Read more

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up.
See full terms