Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
March 1, 2014
Chris
Deployment, PHP
2

Extremely simple deployment with PHPloy

PreviousNext
git-php-deployment

Let me ask you a question: How mad do you get when you have to remember which files you edited and select them on FileZilla to upload to the server? That’s right – very mad. And sometimes you just upload the whole project because you don’t remember what you edited. I have four words for that: “Been there; done that”. Out of that frustration I set out to find a script that would use Git to determine which files I had edited, since this is what Git does best, and upload those to the server through FTP.

I think everbody can agree to this statement of Baki Goxhaj on his blog WPlancer. Deployment, the process of moving your (updated) code to the live server(s), is something everybody has to deal with, but only very advanced people do it in a professional way. I’ve seen web agencies with 100+ employees, most of them developers, releasing stuff with pure drag & drop FTP. Ouch! Unless you are ready to work with professional tools like Jenkins or Capistrano try this tiny tool that totally does the job:

PHPloy is just a simple PHP file run on the bash (plus a config .ini) that copies all changes from the last deployed commit to the defined server. One command on the command line. Rollbacks are also possible, with one line of code. The configuration of a server is… well, one line of code. Super-simple, super-effective. I love stuff like that!

 

A basic workflow (advanced ways are possible too)

Put PHPloy (bash file with pure PHP content and .ini) into your project’s root.

Edit the .ini and put your FTP credentials in there and name your server(s). It’s possible to use lots of servers.

[quickmode]
    staging = ftp://example:password@staging-example.com:21/path/to/installation 
    production = ftp://example:password@production-example.com:21/path/to/installation

Run a deployment via

phploy

to deploy to all servers defined in the .ini (normally just one) or use this line to deploy to a certain one:

phploy --server servername

Done. Please make sure you never put the .ini file into a public place accidently as it holds your FTP credentials.

For rollbacks use

phploy --rollback

to get back to the last deployed version.

 

PHPloy on GitHub

PHPloy tutorial on Baki’s blog

 

This article was written quite a while ago (8 years), please keep this in mind when using the information written here. Links, code and commands might be outdated or broken.

Random articles

  • PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)
  • What’s new in PHPStorm 9What’s new in PHPStorm 9
  • Experimenting with HHVM at Etsy (Link)Experimenting with HHVM at Etsy (Link)
  • Dangerous Performance Myths in the Web (video talk by Thomas Lohner, PHPUG Latvia)Dangerous Performance Myths in the Web (video talk by Thomas Lohner, PHPUG Latvia)
  • Install MINI in 30 seconds inside Ubuntu 14.04 LTSInstall MINI in 30 seconds inside Ubuntu 14.04 LTS
  • MINI2, an extremely simple barebone PHP application on top of SlimMINI2, an extremely simple barebone PHP application on top of Slim
  • MINI, an extremely simple barebone PHP applicationMINI, an extremely simple barebone PHP application
  • How to setup / install PHP 5.6 on Ubuntu 14.04 LTSHow to setup / install PHP 5.6 on Ubuntu 14.04 LTS
  • Support FLARUM, the future of PHP forum scripts (with some dollars on Kickstarter)Support FLARUM, the future of PHP forum scripts (with some dollars on Kickstarter)
deploydeploymentPHPphploy
Share this

2 Comments

  • Anon
    March 21, 2014 5:15 pm

    I find rsync from git to folder seems to work just fine..

    Reply
    • Banago
      March 23, 2014 10:44 pm

      Rsync won’t work over FTP though – PHPloy is an FTP tool.

      Reply

Leave A Comment Cancel reply

photoshop-cc-deal

Adobe offers Photoshop for $9.99 per month (limited deal)

Currently Adobe offers the very latest version of Photoshop (which is Photoshop CC) for just $9.99 or 12,99€ (EU zone:

atomic-design

An introduction into Atomic Design, a super-clean way to style web applications

A super-interesting talk of Brad Frost at beyond tellerrand 2013, explaining the basics of Atomic Design: What is Atomic Design

anti block adblock

Show ads to ad-blockering visitors – with PageFair.com

Interesting news on the dramatically decreasing web ad market: There’s a new service called PageFair that does basically exactly what

php uk conference

Profiling PHP Applications by Bastian Hofmann (video from PHP UK Conference 2014)

The title says it all: Profiling PHP applications.   This article was written quite a while ago (8 years), please

composer

Composer problems ? Try full reset !

Some small Composer commands that might solve your problems: I’ve taken them directly from Jordi Boggiano‘s (Composer co-creator) “In Depth

php

“Belt” adds very clever everyday functions to PHP, comes with JavaScript naming styles and eventually solves the needle/haystack problem

This little projects is basically super-simple, but somehow really really clever and definitly a time-saver: Belt is a typical Composer-loaded

mod-rewrite-ubuntu-14-04-lts

Which server OS version to choose ? Some EOL lists of Debian, Ubuntu and CentOS

Moving running projects (especially smaller ones that you’ve made for clients years ago) from an outdated and not-supported linux version

the-php-login-project

How to install php-login-one-file on Ubuntu 12.04 LTS

This tutorial will show you how to install the one-file version of php-login.net‘s login script (see the full GitHub repository

css3-chrome-font

Google rolls out Chrome 37, finally fixes horrible font-rendering

Google has rolled out Chrome 37 today, a legendary milestone that fixes one of the most annoying “bugs” in frontend

offf-2014

Europeans: Get ready for OFFF conference / festival in Barcelona, May 2014

Designers and frontend guys, this is for you: If you live or simply are in western Europe in May 2014,

1/4

Categories

Search

php
[Link] Excellent PHP best practices, 2014 style
hiphop php
HipHop VM reaches 100% green Unit Tests in Laravel, Drupal, Slim, CodeIgniter etc.
php
PHP 5.6.0 RC1 is available
node.js
PayPal drops Java, goes node.js / JavaScript
php
PHP 5.7 gets refactored core, is 10%-30% faster than PHP 5.5! Wow!
php
Somebody is writing a compiler for PHP, compiles down to machine code, outperforms HHVM
O’Reilly’s Programming JavaScript Applications by Eric Elliott for free (Early Access release)
phpstorm-github-code-color-syntax-theme
Get Github’s syntax highlighting colors in PHPStorm
hack-php
Wow! Facebook devs have rewritten and fixed PHP, releasing it as new language called “Hack” today
How to setup a config-free WordPress, PHP and MySQL (for local development) in Windows 7 / 8 in under 3 minutes
redaktionelle-hochlastseiten
Hochlastseiten mit PHP, MySQL und Apache am Beispiel stern.de (deutscher Artikel)
php uk conference
PHP Opcache Explained by Julien Pauli (video from PHP UK Conference 2014)
mod-rewrite-ubuntu-14-04-lts
EOL lists of Ubuntu, Debian and CentOS for your server plannings
PHPMyAdmin not found after installation ? Here’s a fix (Ubuntu 12.04) !
php
A super-simple introduction into PHP namespaces (7min video)

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy
 
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT