PHPackages                             rickmacgillis/sftp-and-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. [File &amp; Storage](/categories/file-storage)
4. /
5. rickmacgillis/sftp-and-ftp-client

ActiveLibrary[File &amp; Storage](/categories/file-storage)

rickmacgillis/sftp-and-ftp-client
=================================

A flexible FTP, SSL-FTP, and SSH-based SFTP client for PHP. This lib provides helpers that are easy to use to manage the remote files.

1.5.11(4y ago)21.5k↓47.6%MITPHPPHP &gt;=7.2

Since Jul 11Pushed 3y agoCompare

[ Source](https://github.com/rickmacgillis/sftp-and-ftp-client)[ Packagist](https://packagist.org/packages/rickmacgillis/sftp-and-ftp-client)[ RSS](/packages/rickmacgillis-sftp-and-ftp-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (22)Used By (0)

PHP SFTP Client
===============

[](#php-sftp-client)

Originally forked from `nicolab/php-ftp-client`, this project now supports Windows FTP and SSH FTP connections by mashing it with `phpseclib/phpseclib`.

A flexible FTP and SSH-FTP client for PHP. This lib provides helpers easy to use to manage the remote files.

> This package is aimed to remain simple and light. It's only a wrapper of the FTP native API of PHP, with some useful helpers. If you want to customize some methods, you can do this by inheriting one of the [3 classes of the package](src/FtpClient).

Install
-------

[](#install)

- Use composer: *require* `rickmacgillis/php-ftp-client`
- Or use GIT clone command: `git clone git@github.com:rickmacgillis/php-ftp-client.git`
- Or download the library, configure your autoloader or include the 3 files of `php-ftp-client/src/FtpClient` directory.

Getting Started
---------------

[](#getting-started)

Connect to a server FTP :

```
$ftp = new FtpClient();
$ftp->setHost($host);
$ftp->setPass($pass);
$ftp->setUser($user);
$ftp->setPort($port); // Defaults to port 21 if not explicitly set.
$ftp->setPassiveMode($passiveMode); // Set to true. (Defaults to false/active mode.)
$ftp->setTimeout($timeoutSeconds);
$ftp->setUseSsh(false);

$ftp->connect();
```

OR

Connect to a server FTP via SSH (on port 22 or another port) :

```
$ftp = new FtpClient();
$ftp->setHost($host);
$ftp->setPass($pass);
$ftp->setUser($user);
$ftp->setPort($port); // Defaults to port 22 if not explicitly set.
$ftp->setTimeout($timeoutSeconds);
$ftp->setUseSsh(true);
```

Note: The connection is implicitly closed at the end of script execution (when the object is destroyed). Therefore it is unnecessary to call `$ftp->close()`, except for an explicit re-connection.

License
-------

[](#license)

All code is released under the [MIT license](https://github.com/rickmacgillis/php-ftp-client/blob/master/LICENSE).

Credits
-------

[](#credits)

1. PHPSecLib team for building the SFTP integration components.
2. Nicolas Talle (nicolab) for the original FTP client code and inspiration for extending his package.
3. Rick Mac Gillis (rickmacgillis) for merging the two codebases and providing a unified interface for easy use no matter which type of authentication you need for FTP.

TODO
----

[](#todo)

1. Add better test coverage.
2. Add more documentation

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 61.8% 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 ~141 days

Recently: every ~0 days

Total

21

Last Release

1506d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.4

1.5.7PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/3dc3bf254061004028289ba205a02948c18e9aad6c5c584d4d7bbbc4e06f0d53?d=identicon)[CozyLife](/maintainers/CozyLife)

---

Top Contributors

[![Nicolab](https://avatars.githubusercontent.com/u/1688162?v=4)](https://github.com/Nicolab "Nicolab (63 commits)")[![rickmacgillis](https://avatars.githubusercontent.com/u/8941225?v=4)](https://github.com/rickmacgillis "rickmacgillis (7 commits)")[![jooka](https://avatars.githubusercontent.com/u/9852183?v=4)](https://github.com/jooka "jooka (2 commits)")[![vlakoff](https://avatars.githubusercontent.com/u/544424?v=4)](https://github.com/vlakoff "vlakoff (2 commits)")[![hamedmoody](https://avatars.githubusercontent.com/u/9475089?v=4)](https://github.com/hamedmoody "hamedmoody (2 commits)")[![Laurent-Sarrazin](https://avatars.githubusercontent.com/u/1137846?v=4)](https://github.com/Laurent-Sarrazin "Laurent-Sarrazin (2 commits)")[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (2 commits)")[![GuillermoMI](https://avatars.githubusercontent.com/u/6951800?v=4)](https://github.com/GuillermoMI "GuillermoMI (1 commits)")[![hollodotme](https://avatars.githubusercontent.com/u/1557839?v=4)](https://github.com/hollodotme "hollodotme (1 commits)")[![hubdotcom](https://avatars.githubusercontent.com/u/5274747?v=4)](https://github.com/hubdotcom "hubdotcom (1 commits)")[![jaCUBE](https://avatars.githubusercontent.com/u/2111421?v=4)](https://github.com/jaCUBE "jaCUBE (1 commits)")[![jorrit](https://avatars.githubusercontent.com/u/521449?v=4)](https://github.com/jorrit "jorrit (1 commits)")[![jspetrak](https://avatars.githubusercontent.com/u/146057?v=4)](https://github.com/jspetrak "jspetrak (1 commits)")[![kaliberx](https://avatars.githubusercontent.com/u/2434505?v=4)](https://github.com/kaliberx "kaliberx (1 commits)")[![koenhoeijmakers](https://avatars.githubusercontent.com/u/2232776?v=4)](https://github.com/koenhoeijmakers "koenhoeijmakers (1 commits)")[![laoneo](https://avatars.githubusercontent.com/u/251072?v=4)](https://github.com/laoneo "laoneo (1 commits)")[![marcobitebit](https://avatars.githubusercontent.com/u/5910707?v=4)](https://github.com/marcobitebit "marcobitebit (1 commits)")[![mr-box](https://avatars.githubusercontent.com/u/4538605?v=4)](https://github.com/mr-box "mr-box (1 commits)")[![p810](https://avatars.githubusercontent.com/u/3998736?v=4)](https://github.com/p810 "p810 (1 commits)")[![sebastiansommer](https://avatars.githubusercontent.com/u/1651774?v=4)](https://github.com/sebastiansommer "sebastiansommer (1 commits)")

---

Tags

ftphelpersshsftpserverfilessllibssl-ftpssh-ftp

### Embed Badge

![Health badge](/badges/rickmacgillis-sftp-and-ftp-client/health.svg)

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

###  Alternatives

[nicolab/php-ftp-client

A flexible FTP and SSL-FTP client for PHP. This lib provides helpers easy to use to manage the remote files.

6435.3M24](/packages/nicolab-php-ftp-client)[yii2mod/yii2-ftp

A flexible FTP and SSL-FTP client for PHP. This lib provides helpers easy to use to manage the remote files.

32433.0k3](/packages/yii2mod-yii2-ftp)[league/flysystem

File storage abstraction for PHP

13.6k639.1M2.2k](/packages/league-flysystem)[league/flysystem-sftp-v3

SFTP filesystem adapter for Flysystem.

6129.6M91](/packages/league-flysystem-sftp-v3)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[league/flysystem-ftp

FTP filesystem adapter for Flysystem.

2820.8M101](/packages/league-flysystem-ftp)

PHPackages © 2026

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