PHPackages                             royopa/phploy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. royopa/phploy

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

royopa/phploy
=============

PHPloy - Incremental Git (S)FTP deployment tool that supports submodules, multiple servers and rollbacks.

v3.0.16-stable(11y ago)0318MITPHP

Since Feb 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/royopa/phploy)[ Packagist](https://packagist.org/packages/royopa/phploy)[ RSS](/packages/royopa-phploy/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (0)

PHPloy
======

[](#phploy)

[![Latest Stable Version](https://camo.githubusercontent.com/79ef4f1b99f6cc8bcecc5bf52aee3ed792c87c455f30cff2ee0bbf3dd0227df8/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f7068706c6f792f762f737461626c652e737667)](https://packagist.org/packages/royopa/phploy) [![Total Downloads](https://camo.githubusercontent.com/26764e8239b3b3766a49c6044fc9565b50351ad595e4f5c93f36c125f56c039c/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f7068706c6f792f646f776e6c6f6164732e737667)](https://packagist.org/packages/royopa/phploy) [![Latest Unstable Version](https://camo.githubusercontent.com/e09bb7375c117867bd1b72bbabae80095b489c3a925dec54297f9a69eb293c66/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f7068706c6f792f762f756e737461626c652e737667)](https://packagist.org/packages/royopa/phploy) [![License](https://camo.githubusercontent.com/3bdd2ffaebadf7ccdb4e948f499dc38069101717f9ed2e27b8fd5641f79c79ad/68747470733a2f2f706f7365722e707567782e6f72672f726f796f70612f7068706c6f792f6c6963656e73652e737667)](https://packagist.org/packages/royopa/phploy)

**Version 3.0.16-stable**

PHPloy is a incremental Git FTP and SFTP deployment tool. By keeping track of the state of the remote server(s) it deploys only the files that were committed since the last deployment. PHPloy supports submodules, sub-submodules, deploying to multiple servers and rollbacks.

Requirements
------------

[](#requirements)

- PHP 5.3+ command line interpreter (CLI)

Windows users can optionally [download AnsiCon](https://github.com/adoxa/ansicon/releases) to enable the display of colors in the command prompt. Install it by running `ansicon -i` from a command prompt or "Run" window.

Instalation and Usage
---------------------

[](#instalation-and-usage)

Package available on [Composer](https://packagist.org/packages/royopa/phploy).

If you're using Composer to manage dependencies, you can use

```
composer require "royopa/phploy"

```

Or

As any script, you can use PHPloy globally, from your `bin` directory or locally, from your project directory:

### Using PHPloy locally (per project)

[](#using-phploy-locally-per-project)

1. Drop `phploy.phar` into your project.
2. Create the `deploy.ini` file.
3. Run `php phploy.phar` in terminal.

### Using PHPloy globally in Linux

[](#using-phploy-globally-in-linux)

1. Drop `phploy.phar` into `/usr/local/bin` and make it executable by running `sudo chmod +x phploy`.
2. Create the `deploy.ini` file inside your project folder.
3. Run `phploy` in terminal.

### Installing PHPloy globally in Windows

[](#installing-phploy-globally-in-windows)

1. Extract or clone the PHPloy files into a folder of your choice
2. Ensure phploy.bat can find the path to php.exe by either:
    - Adding the path to php.exe to your system path
    - Manually adding the path inside phploy.bat
3. Add the phploy folder to your system path
4. Run `phploy` from the command prompt (from your repository folder)

Adding folders to your *system path* means that you can execute an application from any folder, and not have to specify the full path to it. To add folders to your system path:

1. Press WINDOWS + PAUSE to open Control Panel &gt; System screen
2. Click "Advanced System Settings"
3. Click "Environment Variables"
4. Under "System variables" there should be a variable called "Path". Select this and click "Edit".
5. Keep the existing paths there, add a semi-colon `;` at the end and then type the location of the appropriate folder. Spaces are OK, and no quotes are required.
6. Click OK

deploy.ini
----------

[](#deployini)

The `deploy.ini` file hold your credentials and it must be in the root directory of your project. Use as many servers as you need and whichever configuration type you prefer.

```
; This is a sample deploy.ini file. You can specify as many
; servers as you need and use normal or quickmode configuration.
;
; NOTE: If a value in the .ini file contains any non-alphanumeric
; characters it needs to be enclosed in double-quotes (").

[staging]
scheme = sftp
user = example
pass = password
host = staging-example.com
path = /path/to/installation
port = 22
passive = true
; Files that should be ignored and not uploaded to your server,
; but still tracked in your repository
skip[] = 'src/*.scss'
skip[] = '*.ini'

[production]
quickmode = ftp://example:password@production-example.com:21/path/to/installation
passive = true
; Files that should be ignored and not uploaded to your server,
; but still tracked in your repository
skip[] = 'libs/*'
skip[] = 'config/*'
skip[] = 'src/*.scss'
```

If your password is missing in the `deploy.ini` file, PHPloy will interactively ask you for your password.

The first time it's executed, PHPloy will assume that your deployment server is empty, and will upload ALL the files of your project. If the remote server already has a copy of the files, you can specify which revision it is on using the `--sync` command (see below).

Multiple servers
----------------

[](#multiple-servers)

PHPloy allows you to configure multiple servers in the deploy file and deploy to any of them with ease.

By default PHPloy will deploy to *ALL* specified servers. Alternatively, if an entry named 'default' exists in your server configuration, PHPloy will default to that server configuration. To specify one single server, run:

```
phploy -s servername

```

or:

```
phploy --server servername

```

`servername` stands for the name you have given to the server in the `deploy.ini` configuration file.

If you have a 'default' server configured, you can specify to deploy to all configured servers by running:

```
phploy --all

```

Rollbacks
---------

[](#rollbacks)

**Warning: the --rollback option does not currently update your submodules correctly. Until this is fixed, we recommend that you checkout the revision that you would like to deploy, update your submodules, and *then* run phploy.**

PHPloy allows you to roll back to an earlier version when you need to. Rolling back is very easy.

To roll back to the previous commit, you just run:

```
phploy --rollback

```

To roll back to whatever commit you want, you run:

```
phploy --rollback="commit-hash-goes-here"

```

When you run a rollback, the files in your working copy will revert **temporarily** to the version of the rollback you are deploying. When the deployment has finished, everything will go back as it was.

Note that there is not a short version of `--rollback`.

Listing changed files
---------------------

[](#listing-changed-files)

PHPloy allows you to see what files are going to be uploaded/deleted before you actually push them. Just run:

```
phploy -l

```

Or:

```
phploy --list

```

Upload other files
------------------

[](#upload-other-files)

To upload all files, even the ones not tracked by git (e.g. the Composer vendor directory), run:

```
phploy -o

```

Or:

```
phploy --others

```

Please keep in mind that **all** files not excluded in your deploy.ini will be uploaded.

Updating or "syncing" the remote revision
-----------------------------------------

[](#updating-or-syncing-the-remote-revision)

If you want to update the `.revision` file on the server to match your current local revision, run:

```
phploy --sync

```

If you want to set it to a previous commit revision, just specify the revision like this:

```
phploy --sync="your-revision-hash-here"

```

Submodules
----------

[](#submodules)

Submodules are supported, but are turned off by default since you don't expect them to change very often and you only update them once in a while. To run a deployment with submodule scanning, add the `--submodules` paramenter to the command:

```
phploy --submodules

```

Purging
-------

[](#purging)

In many cases, we need to purge the contents of a directory after a deployment. This can be achieved by specifing the directories in `deploy.ini` like this:

```
; relative to the deployment path
purge[] = "cache/"
; absolute path
purge[] = "/public_html/wp-content/themes/base/cache/"

```

How it works
------------

[](#how-it-works)

PHPloy stores a file called `.revision` on your server. This file contains the hash of the commit that you have deployed to that server. When you run phploy, it downloads that file and compares the commit reference in it with the commit you are trying to deploy to find out which files to upload.

PHPloy also stores a `.revision` file for each submodule in your repository.

Contribute
----------

[](#contribute)

If you've got any suggestions, questions, or anything else about PHPloy, [you should create an issue here](https://github.com/banago/PHPloy/issues).

Credits
-------

[](#credits)

The people that have brought PHPloy to you are:

- [Baki Goxhaj](https://twitter.com/banago) - lead developer
- [Bruno De Barros](https://twitter.com/terraduo) - initial inspiration
- [Fadion Dashi](https://twitter.com/jonidashi) - contributor
- [Simon East](https://twitter.com/SimoEast) - contributor, Windows support
- [Mark Beech](https://github.com/JayBizzle) - contributor
- [Guido Hendriks](https://twitter.com/GuidoHendriks) - contributor

Version history
---------------

[](#version-history)

v3.0.0-alpha (9 August 2014)

- Added SFTP support
- Composer package
- Phar file added

v2.0.0-beta3 (26 May 2014)

- Colored console output is now *optional* and disabled by default on Windows unless Ansicon is detected. (Colors can be disabled through the `--no-colors` command-line option.)
- ANSI color functionality has been moved to a separate class, and is now also a separate project on Github

v2.0.0-beta2 (11 April 2014)

- Added more ANSI colours to output
- Added --debug option which provides much more verbose output
- Added --help option which displays the readme.md file
- Output now clearly indicates if it's running in --list mode
- Upload process now displays number of files in the queue (eg. "1 of 52")
- Internal: ANSI colours are now expressed through simple HTML-like tags such as , etc.
- Internal: git &amp; console commands are now run from a central function to reduce code repetition and potential bugs
- Fictional: phploy now makes your coffee during a long deployment

v2.0.0-beta (April 2014)

- Added support for Windows machines by:
    - removing incompatible UTF characters
    - added phploy.bat
- Added some additional console output and reformatted some of the outputted strings for clarity
- Added command-line option --skip-subsubmodules

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 62.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

2

Last Release

4143d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d40665a360eef88be50ddf2fad41317ab6378c4ef77a767f88050ab22bef402?d=identicon)[royopa](/maintainers/royopa)

---

Top Contributors

[![banago](https://avatars.githubusercontent.com/u/339914?v=4)](https://github.com/banago "banago (89 commits)")[![JayBizzle](https://avatars.githubusercontent.com/u/340752?v=4)](https://github.com/JayBizzle "JayBizzle (22 commits)")[![royopa](https://avatars.githubusercontent.com/u/442991?v=4)](https://github.com/royopa "royopa (13 commits)")[![GuidoHendriks](https://avatars.githubusercontent.com/u/5393965?v=4)](https://github.com/GuidoHendriks "GuidoHendriks (8 commits)")[![fadion](https://avatars.githubusercontent.com/u/374519?v=4)](https://github.com/fadion "fadion (3 commits)")[![saibotd](https://avatars.githubusercontent.com/u/1080347?v=4)](https://github.com/saibotd "saibotd (2 commits)")[![Euphorbium](https://avatars.githubusercontent.com/u/976661?v=4)](https://github.com/Euphorbium "Euphorbium (2 commits)")[![decanus](https://avatars.githubusercontent.com/u/7621705?v=4)](https://github.com/decanus "decanus (2 commits)")[![SimonEast](https://avatars.githubusercontent.com/u/813734?v=4)](https://github.com/SimonEast "SimonEast (1 commits)")[![NathanGiesbrecht](https://avatars.githubusercontent.com/u/1516627?v=4)](https://github.com/NathanGiesbrecht "NathanGiesbrecht (1 commits)")

### Embed Badge

![Health badge](/badges/royopa-phploy/health.svg)

```
[![Health](https://phpackages.com/badges/royopa-phploy/health.svg)](https://phpackages.com/packages/royopa-phploy)
```

###  Alternatives

[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

293952.6k33](/packages/craftcms-feed-me)[fadion/maneuver

Easily deploy Laravel projects via FTP or SFTP, using Git for versioning.

1739.1k](/packages/fadion-maneuver)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)[in2code/in2publish_core

Content publishing extension to connect stage and production server

40143.4k](/packages/in2code-in2publish-core)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4778.9k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
