PHPackages                             spyric/ftpclient - 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. spyric/ftpclient

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

spyric/ftpclient
================

FTPClient for PHP

0.0.1(9y ago)0162MITPHPPHP &gt;=5.3.0

Since Aug 14Pushed 9y ago1 watchersCompare

[ Source](https://github.com/spyric/ftpclient)[ Packagist](https://packagist.org/packages/spyric/ftpclient)[ RSS](/packages/spyric-ftpclient/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

FTP Client for PHP
==================

[](#ftp-client-for-php)

*By Egor Talantsev. ()*

*licensed under the MIT licenses*

USAGE
=====

[](#usage)

**Connection to FTP Host :**

```
$ftp = new FTPClient();
$ftp->connect($host, $ssl, $port, $timeout);
$ftp->login($username, $password);
```

### Using Passive Mode :###

[](#using-passive-mode-)

```
// This uses passive mode
$ftp->passive();

// If you want to disable using passive mode then
$ftp->passive(false);
```

### Using Binary Mode :###

[](#using-binary-mode-)

```
// This uses binary mode, required for downloading binaries like zip
$ftp->binary(true);

// standard is false
```

\###Changing Directory :###

```
// You can use fullpath to change dir
$ftp->changeDirectory('/root_dir/sub_dir');

// or you can use method chaining
$ftp->changeDirectory('/root_dir')->changeDirectory('sub_dir');
```

\###Change To Parent Directory :###

```
$ftp->changeDirectory('/root_dir/sub_dir');

$ftp->parentDirectory(); // now we are in /root_dir
```

\###Getting Current Directory :###

```
// will return current path as string
$ftp->getDirectory();
```

\###Creating Directory :###

```
// creates a directory in current path
$ftp->createDirectory($directoryName);
```

\###Removing Directory :###

```
$ftp->removeDirectory($directoryName);
```

\###Getting Directory List :###

```
// returns directory list as array
$ftp->listDirectory();
```

\###Getting Directory List :###

```
// executes the FTP LIST command, and returns the result as an array
$ftp->rawlistDirectory($parameters, $recursive);
```

\###Deleting File :###

```
$ftp->delete($filename);
```

\###Returns file size (bytes) :###

```
$ftp->size($filename);
```

\###Returns last modified time :###

```
// returns unix timestamp
$ftp->modifiedTime($filename);

// returns formated
$ftp->modifiedTime($filename, $format);
```

\###Renaming files or folders :###

```
$ftp->rename($current, $new);
```

\###Downloading a file :###

```
// Downloads a file from remote host
$ftp->get($localFile, $remoteFile);

// Downloads file to an open file
$ftp->fget($handle, $remoteFile);
```

\###Uploading a file :###

```
// Uploading local file to remote host
$ftp->put($remoteFile, $localFile);

// Uploading from an open file
$ftp->fput($remoteFile, $handle);
```

\###Getting server options :###

```
$ftp->getOption(FTPClient::TIMEOUT_SEC);
```

\###Setting server options :###

```
$ftp->setOption(FTPClient::TIMEOUT_SEC, 30);
```

\###Allocating space for uploading file :###

```
$ftp->allocate($filesize);
```

\###Changing file and directory permissions :###

```
$ftp->chmod($mode, $filename);
```

\###Running custom command on remote server :###

```
$ftp->exec($command);
```

\###Error Handling :### Class throws exception if opetarion fails. So simply use try-catch blocks.

```
try {
    $ftp = new FTPClient();
    $ftp->connect($host, $ssl, $port, $timeout);
    $ftp->loginlogin($username, $password);
} catch (Exception $e) {
    // we got the error!
}
```

Contributing
============

[](#contributing)

Did you find a bug or do you know a better way to do it? Simply just fork and fix it. Then send a pull request.

Specials Thanks
===============

[](#specials-thanks)

Special thanks to Melih Ucar for his package that was used as base for this packeje

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

3607d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d4eb13d7bca3cb087df76012308eb94feb5b5536113bfc5ec81ed558d1908847?d=identicon)[spyric](/maintainers/spyric)

---

Top Contributors

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

---

Tags

phpftpclientclassftpclient

### Embed Badge

![Health badge](/badges/spyric-ftpclient/health.svg)

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

###  Alternatives

[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

4540.5k](/packages/ismaeltoe-osms)[ebics-api/ebics-client-php

PHP library to communicate with bank through EBICS protocol.

6618.6k](/packages/ebics-api-ebics-client-php)

PHPackages © 2026

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