~~login~~ , logic*
Mar 2, 2023
6
Level 1
Getting Connection timed out with flysystem-ftp even when the file appears in FTP
We have some login in my project to put files in an FTP server, we are getting this error:
ErrorException: ftp_fput(): Connection timed out in /var/www/vendor/league/flysystem-ftp/FtpAdapter.php:163.
Despite the error, the files are actually being uploaded to the FTP server. I don't know if we have to close the connection after every file upload. this is the configuration we have :
Storage::extend('ftp', function ($app, $config) {
$adapter = new FtpAdapter(
// Connection options
FtpConnectionOptions::fromArray([
'host' => $config['host'],
'root' => $config['root'],
'username' => $config['username'],
'password' => $config['password'],
'port' => (int)($config['port'] ?? 21),
'ssl' => true,
'timeout' => 90,
'utf8' => false,
'passive' => true,
'transferMode' => FTP_BINARY,
'systemType' => null, // 'windows' or 'unix'
'ignorePassiveAddress' => null,
'timestampsOnUnixListingsEnabled' => false,
'recurseManually' => true
])
);
return new Filesystem($adapter);
});
Please or to participate in this conversation.