通过PHP连接Ftp


Connect Ftp Via PHP

我必须连接到移动站点ftp。我已经尝试使用以下代码,但没有连接。

$ftp_server="ftp://dropbox.moteng.com/";
$ftp_user_name="xxxx";
$ftp_pass="xxxx";
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_pass);

此处登录结果为空。

但相同的登录详细信息在浏览器中工作。

请帮助完成此任务。感谢

直接从手册:

The FTP server address. This parameter shouldn't have any trailing slashes and shouldn't be prefixed with ftp://.

您犯了两个错误,有一个尾部斜杠,并在其前面加上ftp://