PHPackages                             alwex/phpdeploy - 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. alwex/phpdeploy

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

alwex/phpdeploy
===============

full php deployment tool to automate code deployment on multiple hosts/env

v1.5.9(11y ago)12311PHP

Since Feb 11Pushed 9y ago3 watchersCompare

[ Source](https://github.com/alwex/php-deploy)[ Packagist](https://packagist.org/packages/alwex/phpdeploy)[ RSS](/packages/alwex-phpdeploy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (33)Used By (0)

php-deploy
==========

[](#php-deploy)

![Packagist](https://camo.githubusercontent.com/f5a70870b424e6090dfec83658c14374fa9243752920c01149810d6757e726ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616c7765782f7068706465706c6f792e7376673f6d61784167653d323539323030303f7374796c653d706c6173746963)

php-deploy is a full php deployment tool designed to allow very common OR very specific tasks. It's main philosophy is to chain commands as described in a simple configuration file, commands are easily extensible and highly customizable.

Installation using composer
---------------------------

[](#installation-using-composer)

If you use composer you can easily use it on your project. The main binary file will be available on your binary path `bin/pdeploy` and ready to use.

`composer require alwex/phpdeploy`

Initiating the project
----------------------

[](#initiating-the-project)

To use php-deploy you have to initialize your project. Some directory and basic configuration files will be created under the `.php-deploy` directory located in the root of your project.

`bin/pdeploy config:init myproject`

- *.php-deploy/config.ini* -&gt; the main configuration file which describe the global project configuration
- *.php-deploy/environments* -&gt; environment configuration files goes here
- *.php-deploy/Command* -&gt; you put your custom commands here

You may want to modify the config.ini file

Adding some environments
------------------------

[](#adding-some-environments)

In order to add environments simply type

`bin/pdeploy config:addenv production`

Environment file example:

```
# user used for all remote commands
login=mySshLogin

# directory where the project is located
# relatively to the path where you execute
# bin/pdeploy
fromDirectory = ./
# remote or local path where to deploy
# the application
toDirectory = /var/www
# list of hosts where to deploy the app
hosts[] = 'localhost'
hosts[] = 'web1'
hosts[] = 'web2'
# ...
# name of the symlink allowing
# multiple apps in the same path
symlink = current-php-deploy

[deploy]
# PRE TASK
# executed before task
# usually vcs export and build
# of the package to deploy
preTask[] = Deploy\Command\GitExport
preTask[] = Deploy\Command\ComposerInstall
preTask[] = Deploy\Command\TarGz
# deployment stage executed against
# each hosts
onTask[] = Deploy\Command\Scp
onTask[] = Deploy\Command\UnTarGz
# post deployment stage executed
# on each hosts, usually cache clear,
# apache reload and symlink generation
# after this stage, deployment is done!
postTask[] = Deploy\Command\Symlink
# after tasks executed one time only
afterTask[] = ExampleCommand # custom comand

[mytask]
# PRE TASK
preTask[] = Deploy\Command\Symlink
# ON TASK
onTask[] = Deploy\Command\Symlink
# POST TASK
postTask[] = Deploy\Command\Symlink
# AFTER TASK
afterTask[] = Deploy\Command\Symlink

# ... and so on as many tasks as necessary
```

Executing a task
----------------

[](#executing-a-task)

Once you have defined the tasks on the environment ini files, you can simply run them with

`bin/pdeploy task:run --release=0.0.1 --env=production mytask`

Creating custom commands
------------------------

[](#creating-custom-commands)

To add custom commands, simply add it as php classes on the folder `.php-deploy/Command`, you can duplicate the `ExampleCommand.php` to start. Just add this custom command to a task like for example

`afterTask[] = ExampleCommand`

ExampleCommand content:

```
class ExampleCommand extends \Deploy\Command\AbstractCommand {

    /**
     * optionally you may check if all the
     * requirement are met before running
     * the command
     *
     * @throw \RuntimeException
     */
    public function beforeRun() {

        if (file_exists("/tmp/hello.txt")) {
            throw new \RuntimeException("hello file already exists");
        }
    }

    /**
     * execute command and php tasks
     * return the execution status as an integer
     *
     * @return void
     */
    public function run()
    {
        $command = "echo hello > /tmp/hello.txt";
        $this->shellExec($command);
    }

    /**
     * optionally you may check if the command has been
     * correctly done
     *
     * @throw \RuntimeException
     */
    public function afterRun() {

        $expectedValue = 'hello';
        $fileContent = file_get_contents("/tmp/hello.txt");

        if ($fileContent != $expectedValue) {
            throw new \RuntimeException("hello file does not contain expected value '$expectedValue', found '$fileContent'");
        }
    }
}
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~1 days

Total

30

Last Release

4080d ago

Major Versions

0.1.3 → 1.0.02015-02-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63174?v=4)[Alexandre](/maintainers/alwex)[@alwex](https://github.com/alwex)

---

Top Contributors

[![alwex](https://avatars.githubusercontent.com/u/63174?v=4)](https://github.com/alwex "alwex (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/alwex-phpdeploy/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[prestashop/prestashop

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

9.0k15.4k](/packages/prestashop-prestashop)[shopware/deployment-helper

Shopware deployment tools

19305.3k5](/packages/shopware-deployment-helper)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)

PHPackages © 2026

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