You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$host = config('filesystems.disks.ftp.host');
$user = config('filesystems.disks.ftp.username');
$password = config('filesystems.disks.ftp.password');
$ftpConn = ftp_connect($host);
$login = ftp_login($ftpConn, $user, $password);
//
//Enable PASV ( Note: must be done after ftp_login() )
//
$mode = ftp_pasv($ftpConn, TRUE);
// check connection
if ( (!$ftpConn) || (!$login) || (!$mode) ) {
echo 'FTP connection has failed! Attempted to connect to ' . $host . ' for user ' . $user . '.';
} else {
echo 'FTP connection was a success.';
$directory = ftp_nlist($ftpConn, '.');
dd('line');
echo '<pre>' . print_r($directory, true) . '</pre>';
}
ftp_close($ftpConn);
However in both cases I get same error, ftp_rawlist(): php_connect_nonb() failed: Operation now in progress (115) pointing at line lluminate\Foundation\Bootstrap\HandleExceptions::handleError vendor/league/flysystem/src/Adapter/Ftp.php:570 I have tried it via Filezilla and it works fine, the php code runs inside ubuntu docker image. Is there anything I am missing here?
The text was updated successfully, but these errors were encountered:
maybe add in vendor/league/flysystem/src/Adapter/Ftp.php
if (defined('FTP_USEPASVADDRESS')){
ftp_set_option($this->connection, FTP_USEPASVADDRESS, false);
}
before
if ( ! ftp_pasv($this->connection, $this->passive)) {
throw new ConnectionRuntimeException(
'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort()
);
}
The issue above is related to FTP connections, not SFTP connections, this issue should be closed or moved to https://github.com/thephpleague/flysystem-ftp, most likely the issue is misconfiguration of the parameters, "passive" should be true.
So within laravel I am trying to use this package in order to connect to remote host and send or even list files.
So in my config I have:
Now I have also tried native solution like:
However in both cases I get same error,
ftp_rawlist(): php_connect_nonb() failed: Operation now in progress (115)
pointing at linelluminate\Foundation\Bootstrap\HandleExceptions::handleError vendor/league/flysystem/src/Adapter/Ftp.php:570
I have tried it via Filezilla and it works fine, the php code runs inside ubuntu docker image. Is there anything I am missing here?The text was updated successfully, but these errors were encountered: