- How do I install and configure anchu/ftp in Laravel?
- Install it with composer require anchu/ftp. On Laravel 5.5 and later the service provider is auto-discovered; on Laravel 4 and early 5 releases you must register Anchu\Ftp\FtpServiceProvider and the Ftp facade manually in config/app.php. Then add an ftp disk to config/filesystems.php with host, username, password, port, root, passive and ssl keys, and access it through Storage::disk('ftp').
- Which Laravel and PHP versions does anchu/ftp support?
- The package describes itself as a Laravel 4, 5, 6 and 7 FTP service provider, with the last release published in November 2020. It makes no compatibility statements for PHP 8.x or Laravel 8 and above, and it predates the Flysystem 3 migration that Laravel 9 adopted. Treat the supported matrix as Laravel 4 through 7 on PHP 7.x and verify constraints with a dry-run composer resolution before relying on it.
- Does anchu/ftp work with Laravel 9, 10, 11 or 12?
- It is not supported on those versions. Modern Laravel releases depend on league/flysystem 3.x, while anchu/ftp pins the older Flysystem 1.x or 2.x adapters, so Composer will typically fail to resolve or will try to downgrade league/flysystem and break your S3 and cloud disks. If the package is already installed, the practical fix is to swap to Laravel's native ftp or sftp disk rather than upgrade the package.
- Is anchu/ftp still maintained?
- No. The last tagged release was on 7 November 2020 and there has been no subsequent activity, so the package has effectively been abandoned for several years. It has a single maintainer, roughly 220 GitHub stars and no dependents recorded in the Packagist index, meaning there is no succession path or community fork to rely on. For a production dependency that is a governance risk, not just a technical one.
- Can Laravel handle FTP without anchu/ftp?
- Yes. Laravel's filesystem layer has shipped a native ftp driver for years, so you can define an ftp disk in config/filesystems.php and use Storage::disk('ftp') with no extra package at all. For SFTP, current Laravel versions work with league/flysystem-sftp-v3, the actively maintained adapter from the same Flysystem family. In most cases the package only saves you a few lines of configuration.
- How do I use SFTP in Laravel without this package?
- Require league/flysystem-sftp-v3 with Composer, then declare an sftp disk in config/filesystems.php using the sftp driver with host, username, password or private key path, root and timeout options. Access it through the standard Storage facade, for example Storage::disk('sftp')->put() or Storage::disk('sftp')->allFiles(). This gives you the same fluent API as the package while staying on a maintained adapter that Laravel itself supports.
- How do I upload, download and delete files with a Laravel FTP disk?
- Everything goes through the standard Storage facade methods: put, putFile and putFileAs to upload, get and readStream to download, exists and size to inspect, files and allFiles to list, and delete plus makeDirectory and deleteDirectory to manage the remote tree. The package returns the underlying Flysystem results, so most calls give you true or false rather than throwing on failure. Keep the disk name in one configuration point so you can change the driver later without touching call sites.
- Is FTP secure enough for production file transfers?
- Plain FTP sends both credentials and file contents unencrypted over the control and data channels, so anyone on the network path can read them. If you must use FTP, enable explicit FTPS by setting the ssl option to true on the disk and confirm the server supports it. For anything crossing an untrusted network, SFTP is the safer default and removes the need for a documented security exception.
- How do I test FTP file operations in Laravel?
- Storage::fake only works for local disks, so you cannot fake a real FTP connection the way you fake the public or local disk. The practical approach is to hide transfers behind a small interface such as FileTransfer with put, pull, list and delete methods, then bind a fake implementation in your test suite. If you need genuine integration coverage, point the disk at a containerised FTP server like vsftpd or pure-ftpd in CI and keep those tests separate from your unit suite.
- How do I replace anchu/ftp in an existing Laravel project?
- First inventory call sites by searching for Storage::disk( and any direct League\Flysystem usage so you know what actually depends on the package. Introduce a thin internal interface wrapping the operations you use, switch the backing disk to Laravel's native ftp or sftp driver in config/filesystems.php, then remove anchu/ftp and its Flysystem pin with Composer. Run composer update afterwards to confirm your framework upgrade path is no longer blocked, and ship each step separately so the change is reversible.