thephpleague / flysystem

Abstraction for local and remote filesystems
https://flysystem.thephpleague.com
MIT License
13.37k stars 827 forks source link

FTP upload error #1814

Closed hulang closed 2 months ago

hulang commented 2 months ago

Question

Q A
Flysystem Version 3.28.0
Adapter Name FtpAdapter
Adapter version 3.28.0
ftp_fput(): php_connect_nonb() failed: No error (0)

But using native PHP can

<?php
date_default_timezone_set('Asia/Shanghai');

// 联接FTP服务器
$conn = ftp_connect('147.124.251.188');
// 使用username和password登录
ftp_login($conn, 'img_zjjcl_cn', 'zzzzzzzz');

ftp_set_option($conn, FTP_USEPASVADDRESS, false);
ftp_pasv($conn, true);

// 列示文件
$filelist = ftp_nlist($conn, '.');
$filelist['time'] = date('Y-m-d H:i:s');
print_r($filelist);

ftp_put($conn, 'readme1111111.md', 'readme.md', FTP_ASCII);

// 关闭联接
ftp_quit($conn);

run code

There is a readme1111111.md file in FTP

hulang commented 2 months ago

resolved https://github.com/thephpleague/flysystem/issues/1206 Fixed by adding 'passive'=> false, to config