简体   繁体   English

ftp_get大文件超时

[英]ftp_get timeout with large files

I don't have any problem to download files throught ftp with ftp_get except when I have a 4GB file. 除了有4GB的文件外,通过ftp_get ftp下载文件没有任何问题。 It takes some times to get the file and I get this error : 需要一些时间来获取文件,并且出现此错误:

ErrorException: ftp_get(): Timeout ErrorException:ftp_get():超时

I'm using this simple example here : http://php.net/manual/fr/function.ftp-get.php 我在这里使用这个简单的例子: http : //php.net/manual/fr/function.ftp-get.php

$conn_id = ftp_connect($ftp_server);

$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
    echo "Le fichier $local_file a été écrit avec succès\n";
} else {
    echo "Il y a un problème\n";
}

Is there any way to increase the timeout ? 有什么办法可以增加超时时间? Or maybe another solution ? 还是另一种解决方案?

Thanks ! 谢谢 !

Had the same problem before. 以前有同样的问题。 I was trying to get too many files at one time. 我试图一次获取太多文件。

The solution was to limit the amount of files to download and then if you have access to the FTP, try to improve the timeout or check the log to get more details. 解决方案是限制下载文件的数量,然后,如果您可以访问FTP,请尝试改善超时时间或检查日志以获取更多详细信息。 Check also if you can split this file in smaller ones. 还要检查是否可以将此文件拆分为较小的文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM