PHP Fopen创建文件但不写

问题描述 投票:0回答:1

以下是我的PHP代码

$output = fopen('ftp://.io/inventory/'.$file_name, 'a');
fputcsv($output, array('ImportType','productCode','sku','locationCode','onHand'));
$newrow = array(0=>'AC',1=>'test',3=>'test2',4=>'test3',5=>'test4');
fputcsv($output,$newrow);

文件被创建了,但没有写入任何数据。

我也试过改变 fopen 参数从 aw,它根本就没有创建文件。

777权限都是为该目录设置的。

更多细节:当我通过Filezilla上传文件时,它可以工作,我在Filezilla的FTP设置是 Explicit FTP over TLS and the Transfer mode is set to Passive

php fopen
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.