PHPackages                             phpsu/phpsu - 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. [Database &amp; ORM](/categories/database)
4. /
5. phpsu/phpsu

ActiveLibrary[Database &amp; ORM](/categories/database)

phpsu/phpsu
===========

Synchronisation Utility: File and Database

4.3.0(12mo ago)1685.6k↓47.3%7[16 issues](https://github.com/phpsu/phpsu/issues)[1 PRs](https://github.com/phpsu/phpsu/pulls)MITPHPPHP ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0CI failing

Since Jan 15Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/phpsu/phpsu)[ Packagist](https://packagist.org/packages/phpsu/phpsu)[ Docs](https://phpsu.de/)[ RSS](/packages/phpsu-phpsu/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (39)Used By (0)

Phpsu: Synchronisation Utility: File and Database
=================================================

[](#phpsu-synchronisation-utility-file-and-database)

[![Latest Version](https://camo.githubusercontent.com/8712ac35ed576ade6cef071792eab50088e849d68a0c14f6ea4d40d154a89b41/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d7072652f70687073752f70687073752e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpsu/phpsu/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Coverage Status](https://camo.githubusercontent.com/c59093fb84b15339f28a527d59a19c3a5efaabe97ae8f42b08b9377879da4132/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f70687073752f70687073752e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/phpsu/phpsu)[![Infection MSI](https://camo.githubusercontent.com/81c1c145f9283d9898cc15516bd0b6fa88209887f7f5520e653b653a0931ff01/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742d7371756172652675726c3d68747470733a2f2f62616467652d6170692e737472796b65722d6d757461746f722e696f2f6769746875622e636f6d2f70687073752f70687073752f6d6173746572)](https://infection.github.io)[![Total Downloads](https://camo.githubusercontent.com/833144eb17d8467d8061ee7945a393818be938626ca10edcc89c6f11b343607c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f70687073752f70687073752e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/phpsu/phpsu)

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) and [PSR-12](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md). If you notice compliance oversights, please send a patch via pull request.

Install
-------

[](#install)

### Via Composer:

[](#via-composer)

```
composer require --dev phpsu/phpsu
```

#### Via Composer, with conflicting versions

[](#via-composer-with-conflicting-versions)

If you have problems with conflicting versions eg. symfony:&lt;5 you can use the [composer-bin-plugin](https://github.com/bamarni/composer-bin-plugin).

```
composer require --dev bamarni/composer-bin-plugin
composer bin phpsu require --dev phpsu/phpsu
#  we recommend to install it with the auto installation scripts:
composer config scripts.bin "echo 'bin not installed'"
composer config scripts.post-install-cmd '@composer bin all install --ansi'
composer config scripts.post-update-cmd '@composer bin all update --ansi'
echo '/vendor-bin/**/vendor' >> .gitignore
```

### Via Docker:

[](#via-docker)

if you want to use phpsu via Docker we have a minimal phpsu docker image: [phpsu/phpsu](https://hub.docker.com/r/phpsu/phpsu).

you can execute any phpsu command via something like this:

`docker run --rm -it -u $(id -u):$(id -g) -v $(pwd):/app -v ~/.ssh:/home/phpsu/.ssh phpsu/phpsu:latest phpsu ssh production`

[read more about docker usage](docs/Docker.md)

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

[](#requirements)

The following versions of PHP are supported by this version.

- PHP `8.1`, `8.2`, `8.3`
- Compatible and continuously tested with symfony `5`, `6`, `7`
- for older versions go to [version 3.1.0](https://github.com/phpsu/phpsu/tree/3.1.0)
- for older versions go to [version 2.3.0](https://github.com/phpsu/phpsu/tree/2.3.0)
- or [version 1.1.0](https://github.com/phpsu/phpsu/tree/1.1.0)

Required for synchronisation are:

- `bash` on execution System (and the ssh user needs to have a shell where `set -o pipefail` is possible (eg. not sh on debian as that is dash and does not work))
- `ssh` on execution System
- `rsync` on executing System
- `mysqldump` on source System
- `mysql` on destination Systems

Unfortunately we do not support Windows yet.

Documentation
-------------

[](#documentation)

The full [Documentation](docs/index.md) can be found in the `/docs` Directory.

Configuration Example
---------------------

[](#configuration-example)

Simple configuration example `phpsu-config.php`:

```
