Homestead 中使用 ftp 连接服务出错,是否需要额外配置?
在 homestead 中使用 laravel 自带的 Storage 连接 FTP 服务器,可以正常连接但取不到其中的内容,也无法往里面put数据,但在测试服务器中可以,是不是homestead中需要配置什么东西才能使用 ftp ?
Storage::disk('smil_ftp')->put('/xxxx/PO201801290001.csv', 'testtest')
PHP Warning: ftp_chdir(): Failed to change directory. in /home/vagrant/source-code/project/php/car/code/vendor/league/flysystem/src/Adapter/Ftp.php on line 389
PHP Warning: ftp_fput(): Illegal PORT command. in /home/vagrant/source-code/project/php/car/code/vendor/league/flysystem/src/Adapter/Ftp.php on line 263
ftp 服务为主动模式,使用其他ftp工具或在测试服务器上都能正常连接ftp服务,但在homestead中会出问题。
我的filesystem.php
配置
'smil_ftp' => [
'driver' => 'ftp',
'host' => 'x.y.z',
'username' => 'xxxx'',
'password' => 'xxxxx',
// 'port' => 21,
'passive' => false,
'timeout' => 30,
]
推荐文章: