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

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

melihucar/ftpclient
===================

FTPClient for PHP

1.0(12y ago)28181.1k↑66.7%9[1 issues](https://github.com/melihucar/ftpclient/issues)MITJavaScriptPHP &gt;=5.3.0

Since Nov 27Pushed 10y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (5)Used By (0)

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

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

[![Build Status](https://camo.githubusercontent.com/e143219b0633116eae376f1489fc426db989b7680c93480a5315fe4c0f084260/68747470733a2f2f6170692e7472617669732d63692e6f72672f6d656c6968756361722f667470636c69656e742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/melihucar/ftpclient)[![Total Downloads](https://camo.githubusercontent.com/d24bbaa129e6e66c99de1f26feb5b0ec3508f66464342cb774e0d8b367c389a9/68747470733a2f2f706f7365722e707567782e6f72672f6d656c6968756361722f667470636c69656e742f646f776e6c6f6164732e706e67)](https://packagist.org/packages/melihucar/ftpclient)[![Latest Stable Version](https://camo.githubusercontent.com/692ef6b2ac44f5136eb099e9e24e253ede8d077a542a0b28411f082ea92d57cf/68747470733a2f2f706f7365722e707567782e6f72672f6d656c6968756361722f667470636c69656e742f762f737461626c652e706e67)](https://packagist.org/packages/melihucar/ftpclient)

[![Support via Gittip](https://camo.githubusercontent.com/564fbb9bbc009b853c485bb96153a0f355834f453b336c0567241be2bea184e7/68747470733a2f2f7261776769746875622e636f6d2f74776f6c66736f6e2f6769747469702d62616467652f302e312e302f646973742f6769747469702e706e67)](https://www.gittip.com/melihucar)

*By Melih Ucar. ()*

*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.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity42

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% 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 ~102 days

Total

4

Last Release

4247d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/982959?v=4)[Melih Uçar](/maintainers/melihucar)[@melihucar](https://github.com/melihucar)

---

Top Contributors

[![melihucar](https://avatars.githubusercontent.com/u/982959?v=4)](https://github.com/melihucar "melihucar (25 commits)")[![peerrabe](https://avatars.githubusercontent.com/u/446964?v=4)](https://github.com/peerrabe "peerrabe (5 commits)")[![tim-heinsohn](https://avatars.githubusercontent.com/u/121209?v=4)](https://github.com/tim-heinsohn "tim-heinsohn (2 commits)")[![ivankovbas](https://avatars.githubusercontent.com/u/9944149?v=4)](https://github.com/ivankovbas "ivankovbas (1 commits)")[![mrjgreen](https://avatars.githubusercontent.com/u/2183391?v=4)](https://github.com/mrjgreen "mrjgreen (1 commits)")[![parsingeye](https://avatars.githubusercontent.com/u/126904?v=4)](https://github.com/parsingeye "parsingeye (1 commits)")

---

Tags

phpftpclientclassftpclient

### Embed Badge

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

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

###  Alternatives

[ismaeltoe/osms

PHP library wrapper of the Orange SMS API.

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

PHP library to communicate with bank through EBICS protocol.

6411.1k](/packages/ebics-api-ebics-client-php)[wormling/phparia

Asterisk REST Interface (ARI) client for PHP.

419.8k](/packages/wormling-phparia)

PHPackages © 2026

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