I read value of a file csv as:
//$mypath . '/' . $filename <=> ../abc.csv
$val = file_get_contents($mypath . '/' . $filename);
$escaped = pg_escape_bytea($val);
$model->addFileImport($tmp, $data['email'], $escaped);
My file ia about 100MB. In php.ini setting : memory_limit = 128M
But it still show errort:Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 133120 bytes) in...
at row: $val = file_get_contents($mypath . '/' . $filename);
I had fixed by add ini_set('memory_limit', '-1');
:
//$mypath . '/' . $filename <=> ../abc.csv
ini_set('memory_limit', '-1');
$val = file_get_contents($mypath . '/' . $filename);
$escaped = pg_escape_bytea($val);
$model->addFileImport($tmp, $data['email'], $escaped);
But it show error :
Fatal error: Out of memory (allocated 230686720) (tried to allocate 657099991 bytes) in C:\wamp\www\joomlandk\components\com_servicemanager\views\i0701\view.html.php on line 112
at row $escaped = pg_escape_bytea($val);
Why? How fix that error?