PHPackages                             hugsbrugs/php-ftp - 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. hugsbrugs/php-ftp

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

hugsbrugs/php-ftp
=================

PHP FTP Utilities

1.0(9y ago)715.7k—7.1%4[2 issues](https://github.com/hugsbrugs/php-ftp/issues)PHP

Since Mar 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/hugsbrugs/php-ftp)[ Packagist](https://packagist.org/packages/hugsbrugs/php-ftp)[ RSS](/packages/hugsbrugs-php-ftp/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

php-ftp
=======

[](#php-ftp)

PHP FTP Utilities

If you also need SFTP : [php-sftp](https://github.com/hugsbrugs/php-sftp)

Install
-------

[](#install)

Install package with composer

```
composer require hugsbrugs/php-ftp

```

In your PHP code, load librairy

```
require_once __DIR__ . '/vendor/autoload.php';
use Hug\Ftp\Ftp as Ftp;
```

Usage
-----

[](#usage)

Test FTP connection

```
Ftp::test($server, $user, $password, $port = 21);
```

Check if a file exists on Ftp Server

```
Ftp::is_file($server, $user, $password, $remote_file, $port = 21);
```

Delete a file on remote FTP server

```
Ftp::delete($server, $user, $password, $remote_file, $port = 21);
```

Recursively deletes files and folder in given directory (If remote\_path ends with a slash delete folder content otherwise delete folder itself)

```
Ftp::rmdir($server, $user, $password, $remote_path, $port = 21);
```

Recursively copy files and folders on remote FTP server (If local\_path ends with a slash upload folder content otherwise upload folder itself)

```
Ftp::upload_dir($server, $user, $password, $local_path, $remote_path, $port = 21);
```

Download a file from remote Ftp server

```
Ftp::download($server, $user, $password, $remote_file, $local_file, $port = 21);
```

Download a directory from remote FTP server (If remote\_dir ends with a slash download folder content otherwise download folder itself)

```
Ftp::download_dir($server, $user, $password, $remote_dir, $local_dir,
$port = 21);
```

Rename a file on remote FTP server

```
Ftp::rename($server, $user, $password, $old_file, $new_file, $port = 21);
```

Create a directory on remote FTP server

```
Ftp::mkdir($server, $user, $password, $directory, $port = 21);
```

Create a file on remote FTP server

```
Ftp::touch($server, $user, $password, $remote_file, $content, $port = 21);
```

Upload a file on FTP server

```
Ftp::upload($server, $user, $password, $local_file, $remote_file = '', $port = 21);
```

List files on FTP server

```
Ftp::scandir($server, $user, $password, $path, $port = 21);
```

Get default login FTP directory aka pwd

```
Ftp::pwd($server, $user, $password, $port = 21);
```

Tests
-----

[](#tests)

Edit example/test.php with your FTP parameters then run

```
php example/test.php
```

To Do
-----

[](#to-do)

PHPUnit Tests

Author
------

[](#author)

Hugo Maugey [visit my website ;)](https://hugo.maugey.fr)

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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 ~0 days

Total

2

Last Release

3392d ago

Major Versions

0.1 → 1.02017-03-20

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/hugsbrugs-php-ftp/health.svg)

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

PHPackages © 2026

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