This error message is being presented, any suggestions?
Allowed memory size of 33554432 bytes exhausted (tried to allocate 43148176 bytes) in php
Doing :
ini_set('memory_limit', '-1');
is never good. If you want to read a very large file, it is a best practise to copy it bit by bit. Try the following code for best practise.
$path = 'path_to_file_.txt';
$file = fopen($path, 'r');
$len = 1024; // 1MB is reasonable for me. You can choose anything though, but do not make it too big
$output = fread( $file, $len );
while (!feof($file)) {
$output .= fread( $file, $len );
}
fclose($file);
echo 'Output is: ' . $output;