flysystem: FTP ssl problem
Hi,
I am using Laravel 5.2 with the Storage adapter for connecting to a FTP server with SSL. I am getting this error and don’t know why…
[ErrorException]
ftp_rawlist(): SSL read failed
PHP Fatal error: Uncaught ErrorException: fclose(): supplied resource is not a valid stream resource in /home/test/public_html/vendor/league/flysystem/src/Adapter/Ftp.php:495
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fclose(): suppl...', '/home/test/...', 495, Array)
#1 /home/test/public_html/vendor/league/flysystem/src/Adapter/Ftp.php(495): fclose(Resource id #209)
#2 /home/test/public_html/vendor/league/flysystem/src/Adapter/Ftp.php(191): League\Flysystem\Adapter\Ftp->isConnected()
#3 /home/test/public_html/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php(609): League\Flysystem\Adapter\Ftp->disconnect()
#4 [internal function]: League\Flysystem\Adapter\AbstractFtpAdapter->__destruct()
#5 {main}
thrown in /home/test/public_html/vendor/league/flysystem/src/Adapter/Ftp.php on line 495
This is my config “config/filesystems.php”:
'ftp' => [
'driver' => 'ftp',
'host' => env('FTP_SERVER'),
'port' => env('FTP_PORT'),
'username' => env('FTP_USERNAME'),
'password' => env('FTP_PASSWORD'),
'passive' => true,
'ssl' => true,
'timeout' => 30,
'root' => '/',
],
This is my code:
Storage::disk('ftp')->allFiles();
My config is correct and I tested it on 2 machines, both giving the same error… Before I used FuelPHP and never had any problems with FTP SSL…
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 1
- Comments: 21 (5 by maintainers)
Ok. Inside the configuration file like this:
‘ftp’ => [ ‘driver’ => ‘ftp’, ‘host’ => ‘ftp.example.com’, ‘username’ => ‘your-username’, ‘password’ => ‘your-password’, ‘passive’ => ‘false’, ‘ignorePassiveAddress’ => true, ‘port’ => 21, ]
and it works.