I'm using phpseclib to connect an sftp server, and I use $sftp->nlist
to list the directories. I can list all small directories, but when listing one with more than 8000 files the memory limit is exceeded. I've already set ini_set('memory_limit','128M')
and ini_set('max_execution_time', '300');
but it is impossible to wait for the response of the request.
Is there any way to recover this array little by little and free up the memory?
Sorry for bad English
ini_set("display_errors",true);
ini_set('memory_limit', '128M');
ini_set('max_execution_time', '300');
set_include_path("/var/www/cremesp.com/_class/API/UnnamedOpenSourceGroup/phpseclib/");
include_once("Net/SFTP.php");
$ftp_server = "*****";
$ftp_username = "*****";
$ftp_password = "*****";
$sftp = new Net_SFTP($ftp_server, *****);
$sftp->login($ftp_username, $ftp_password);
$files_proc = $sftp->nlist("/PROC/");
as I said, I can list other directories, but / PROC is the largest and takes about 150 seconds to respond