如何解决不确定如何在 Laravel 中为 SFTP 服务器创建 FTP 文件系统
我的 php 中有这个类:
<?php
namespace App\Stuff;
use Illuminate\Support\Facades\Storage;
class SomethingUpdater
{
public static function test() {
$ftp = self::getFtpInterface();
$fileList = $ftp->files('FILES\MOREFILES');
dd($fileList);
}
public static function getFtpInterface() : \Illuminate\Contracts\Filesystem\Filesystem
{
return Storage::createFtpDriver([
'driver' => 'sftp','host' => 'sftp://cs.site.co.uk','username' => 'siteuser','password' => 'sitepassword',// 'port' => '21',// your ftp port
'timeout' => '30',// timeout setting
]);
}
}
起初我在 createFtpDriver
中没有“驱动程序”,但添加它没有用。在 sftp://
字段中取出 host
无效。我应该在这里做什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。