PHPackages                             zdenekgebauer/ftp-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. zdenekgebauer/ftp-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

zdenekgebauer/ftp-client
========================

Object oriented FTP client for PHP

v2.0.0(5y ago)2161WTFPLPHPPHP &gt;=8.0

Since Jan 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/zdenekgebauer/ftpclient)[ Packagist](https://packagist.org/packages/zdenekgebauer/ftp-client)[ RSS](/packages/zdenekgebauer-ftp-client/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

FTP Client
==========

[](#ftp-client)

Object oriented FTP (SFTP) client for PHP

[![](https://github.com/zdenekgebauer/ftpclient/workflows/build/badge.svg)](https://github.com/zdenekgebauer/ftpclient/workflows/build/badge.svg)

Installation
------------

[](#installation)

`composer require zdenekgebauer/ftp-client`

Usage
-----

[](#usage)

```
$ftp = new ZdenekGebauer\FtpClient\FtpClient();
$ftpOptions = new ZdenekGebauer\FtpClient\FtpOptions();
// set connection parameters
$ftpOptions->host = 'localhost';
$ftpOptions->username = 'login';
$ftpOptions->password = 'password';
// optional parameters
// $ftpOptions->port = 21;
// $ftpOptions->timeout = 120;
// $ftpOptions->ssl = true;

try {
    $ftp->connect($ftpOptions);
} catch (\ZdenekGebauer\FtpClient\FtpException $exception) {
    // do something
}
// set passive mode
$ftp->pasv(true);
echo 'PWD: ', $ftp->pwd();

// upload local file to server
try {
    $ftp->put('remote.txt', 'local.txt');
} catch (\ZdenekGebauer\FtpClient\FtpException $exception) {
    // do something
}

// download file from server (most of methods throws FtpException)
$ftp->get( 'download.txt', 'remote.txt');

// create directory on server, recursive
$ftp->mkdir('/', 'new/folder', 0777);

// delete remote directory
$ftp->rmdir('/folder/subfolder');

// change directory
$ftp->chdir('remote/folder');

// upload directory
$ftp->putDirectory('/', '/local/folder', 'remote/folder');

// get tree with remote directories
/** @var array $tree */
$tree = $ftp->tree('tree');

// delete remote file
$ftp->delete('remote.txt');

// rename remote file or directory
$ftp->rename('file.txt', 'new-name.txt');
$ftp->rename('folder', 'new-folder');

// get content of remote file
var_dump($ftp->getFileContent('remote.txt'));

// check if directory exists
var_dump($ftp->isDirectory('/folder'));

// check if file exists
var_dump($ftp->isFile('file.txt'));

// copy remote file
$ftp->copyFile('file.txt', 'copy.txt');

// copy remote directory
$ftp->copyDirectory('/', '/folder', '/copy-folder');

// chmod remote file
$ftp->chmod('file.txt', 0777);

$ftp->close();
```

Testing
-------

[](#testing)

Tested with [Codeception](https://codeception.com/) framework. Tests requires valid connection parameters for FTP server specified in environment file(s) /tests/\_envs/\*.yml

Licence
-------

[](#licence)

Released under the [WTFPL license](copying.txt) .

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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

2

Last Release

1949d ago

Major Versions

v1.0.0 → v2.0.02021-01-06

PHP version history (2 changes)v1.0.0PHP 7.4

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/36ef4dac7600d246b5d5bf20592da1f536607276921f31000886c6350d39f278?d=identicon)[zdenekgebauer](/maintainers/zdenekgebauer)

---

Top Contributors

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

---

Tags

phpftpsftp

### Embed Badge

![Health badge](/badges/zdenekgebauer-ftp-client/health.svg)

```
[![Health](https://phpackages.com/badges/zdenekgebauer-ftp-client/health.svg)](https://phpackages.com/packages/zdenekgebauer-ftp-client)
```

###  Alternatives

[altayalp/ftp-client

FTP and SFTP client for Php

1971.3k](/packages/altayalp-ftp-client)[brunodebarros/git-deploy-php

git-deploy-php is a simple php-based tool that deploys your Git repositories to FTP/SFTP servers, and keeps them updated automatically.

2921.2k](/packages/brunodebarros-git-deploy-php)[banago/bridge

A PHP class to transfer data using different protocols (sftp, ftp, http, etc). Utilizes PHPs ssh2, ftp and curl functions if available.

2115.1k2](/packages/banago-bridge)

PHPackages © 2026

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