pear/net_ftp
PEAR Net_FTP is a PHP library for connecting to FTP servers, browsing directories, and transferring files. It provides an object-oriented API for common FTP operations like login, upload/download, rename, delete, and permissions handling.
This package is an archived PEAR package (pear/net_ftp) offering a minimal OOP wrapper over PHP’s native ftp_* functions. Due to its age (archived, unmaintained, 3 stars), it should only be used when maintaining existing legacy systems that already depend on it—never for new projects.
To begin:
pear install Net_FTP (requires PEAR to be installed and in include_path)require_once 'Net/FTP.php'; (after placing Net/FTP.php in your include_path)$ftp = new Net_FTP();
$ftp->connect('ftp.example.com');
$ftp->login('user', 'password');
$ftp->put('remote.txt', 'local.txt'); // upload
$ftp->get('local_copy.txt', 'remote.txt'); // download
ftp_*() calls with Net_FTP only to unify syntax in older codebases (e.g., pre-Composer apps).true/false or PEAR_Error. Always check:
if (PEAR::isError($result = $ftp->put(...))) {
$error = $ftp->getError();
// log or handle
}
$ftp->setPassive(true) before transfers—active FTP is blocked by most firewalls.PEAR::setErrorHandling(PEAR_ERROR_DIE)) only in CLI tools, or check manually.ftp_set_option() usage may break on PHP ≥8.1 due to stricter type checks. Validate on target runtime.require_once and correct include_path—conflicts with Composer-based Laravel autoloading.ftp_connect() → ftp_* for trivial casesleague/flysystem + league/flysystem-ftp (and migrate to league/flysystem-ftp-secure for TLS)How can I help you explore Laravel packages today?