Issue with scripte (ARRAY)

Hello All,

I am getting this error:

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 71908481 bytes) in /home/httpd/vhosts/example.org/httpdocs/converter/file_reader.php on line 6

// SUCK FILE INTO ARRAY 
    $rows = file('/home/httpd/vhosts/seas-network.org/httpdocs/uploads/EO1.LST') or die("Could not read file contents");
    foreach( $rows as $i => $row ) {
        print_r($row);
        echo "line length: ".strlen($row)."<br/>";

       // PARSE EACH LINE
       $data = array();
       $data[0] = substr( $row, 0,9);
       $data[1] = substr( $row, 9,70);  

Thanks for your help ahead of time, if there is a way around this issue please tell me as one of the files is 208mb is size and these files would be uploaded to the system every month

Sincerely,
Christopher
SEAS-Net

PHP is given 64MB to ‘do its thing’. You can’t fit a 208MB file into an application that only has 64MB available. Try upping the memory PHP is allowed to use (can be found in php.ini). Also, make sure the hardware can supply the required amount of memory (for 208MB files, this would be a minimum of 256MB).

Sponsor our Newsletter | Privacy Policy | Terms of Service