Automatic Deploying Your Lumen App with PHP Deployer So You Don't Have to Manually Do It.

Automatic Deploying Your Lumen App with PHP Deployer So You Don't Have to Manually Do It.

Automatically deploying your Lumen App with PHP Deployer (and zero downtime) so you don't have to manually do it. PHP Deployer is a great little utility for deploying your PHP app via command line. It doesn't force you to use any specific tech stack and simplifies the process of getting your app live.

PHP Deployer is a great little utility for deploying your PHP app via command line. It doesn't force you to use any specific tech stack and simplifies the process of getting your app live.

Prerequisites

This blog post assumes the following:

  • You have an app or website written in PHP, be it a popular framework or just plain ol' PHP
  • You are familiar with command line, SSH and are looking for a deployment method
  • You have SSH access to the server where your site/app will be hosted
  • Your website is not mission critical (there might be errors :wink:)

I have a Lumen app which I will be deploying with Deployer in this blog post, so there might be Lumen/Laravel specific commands and roles.

Install

There are a couple of ways you can  install deployer. To keep my code device & environment agnostic, I have opted for the  composer method.

This means I don't have to set up deployer on the machine if I wish to deploy my app, just SSH access and composer.

The composer version of deployer is run with php vendor/bin/dep, however for the rest of this tutorial I will reference the global command dep.

Deployment and finishing

This may seem like an odd step to put here, but seeing the finished result will help you understand the configuration.

Once deployed (the example below has a couple of deployments), a PHP Deployer app has the following folder & file structure in the deploy_path location:

  • current -> releases/2
  • .dep/
  • releases/
  • 1/
  • ... your application code
  • .env -> ../../shared/.env
  • 2/
  • ... your application code
  • .env -> ../../shared/.env
  • shared/
  • .env
  • storage/

(I hope that makes sense).

php

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Hire PHP Developer - Best PHP Web Frameworks for Web Development

Hire our Laravel, CodeIgniter, YII, Zend, Cake PHP, Core PHP developers for your custom web development projects. Choose best PHP Web Frameworks & get satisfactory results.

Hire PHP Developer

Looking to develop a PHP based website from scratch or revamp your existing website? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** has always been an industry leader for companies and business owners looking to hire...

Noteworthy PHP Development Tools that a PHP Developer should know in 2021!

![This is image title](https://telegra.ph/file/856eae74f33107c93ca2c.jpg "This is image title") Hypertext Preprocessor, commonly known as PHP, happens to be one of the most widely used server-side scripting languages for developing web...

Top PHP web development company| PHP development services India

Are you looking for a php web development company? ValueCoders is a leading software company with 16+ years of experience offering PHP website development services to global clients. 4200+ projects | 2500+ Clients| 450+ Experts.

Custom PHP Development Company | PHP Web Development Service

One programming language that has its root in Website development even at present is PHP Website Development. The PHP programming is executed on the server side which means it functions on web servers which helps the website in its...