1

I'm trying to upload file via Laravel filesystem abstraction on two different remote servers with:

Storage::disk('sftp')->put($fileName, $file);
Storage::disk('ftp')->put($fileName, $file);

The FTP works... but the SFTP return error "Unable to connect to SFTP host".

If i try to connect to SFTP host using FIleZilla with same credentials on same machine and it works.

I configured SFTP driver disk on config/filesystems.php like this:

'sftp' => [
            'driver' => 'sftp',
            'host' => env('SFTP_HOST'),
            'username' => env('SFTP_USERNAME'),
            'password' => env('SFTP_PASSWORD'),
            'port' => 22,
            'visibility' => 'public',
            'permPublic' => 0755,
        ],

I don't understand why is not working, please help.

I expect to upload file properly.

DEVX
  • 11
  • 3

0 Answers0