ftp_get内存泄漏

时间:2012-05-18 20:14:32

标签: php ftp

目前我有一个脚本可以执行此类操作:

//Connect to the FTP server    
$conn_id = connect_to_server($server, $user, $password);

//Switch to the directory with the files
ftp_chdir($conn_id, $directory);

//Get the contents of the current directory then iterate over them
$contents = ftp_nlist($conn_id, ".");


//loop through files and download them
foreach($contents as $file) {
  ftp_get($conn_id, $local_filename, $file, FTP_BINARY);
}

问题是ftp_get气球失控,并耗尽内存。我发现的唯一解决方案是在每次ftp_get连接之前关闭连接。

有没有办法在不关闭连接的情况下释放ftp_get内存?

0 个答案:

没有答案