0
Good morning!! I have the following situation, I need to do an Excel spreadsheet import (.xml).
Only the problem is that my spreadsheet has over 100,000 records and php can’t read everything. The code is working perfectly for spreadsheet with 2500 records. Is there any way I can get him to read the 100,000?
Obg.
Follows the code;
$arquivo = new DOMDocument();
$arquivo->load($_FILES['arquivo']['tmp_name']);
$linhas = $arquivo->getElementsByTagName("Row");
$listaArquivo = [];
foreach ($linhas as $linha) {
$listaTemp = [
$linha->getElementsByTagName("Data")->item(0)->nodeValue,
$linha->getElementsByTagName("Data")->item(1)->nodeValue,
$linha->getElementsByTagName("Data")->item(2)->nodeValue,
$linha->getElementsByTagName("Data")->item(3)->nodeValue,
$linha->getElementsByTagName("Data")->item(4)->nodeValue,
$linha->getElementsByTagName("Data")->item(5)->nodeValue,
$linha->getElementsByTagName("Data")->item(6)->nodeValue,
$linha->getElementsByTagName("Data")->item(7)->nodeValue,
$linha->getElementsByTagName("Data")->item(8)->nodeValue
];
array_push($listaArquivo, $listaTemp);
// echo json_encode($listaTemp);
}
exit();
I answered your comment there
– mer.guilherme.uem
in the file readArchive.php prints the values that are preset in these variables, because it may be that these ini_set directives are disabled echo ini_set('upload_max_filesize'). '<br>'; echo ini_get('post_max_size'). '<br>';
– Romeu Gomes - Brasap
ah, and how big is this CSV with 100k lines.....
– Romeu Gomes - Brasap
Hi, so the problem is this memory limit, it’s not setting to 150M the ini_set. when I echo in ini get it gets 8M. I have tested and researched all the ways to change the size and none worked. 
ini_set('post_max_size', '200M');
ini_set('upload_max_filesize', '200M');
ini_set('max_execution_time', '200M');
ini_set('max_input_time', '200M');
ini_set('memory_limit', '200M');
set_time_limit(65536);

// o tam do arquivo é 110M e é xml ( não é csv).
– mer.guilherme.uem