On Thursday 27 September 2007 04:21, Carlton Whitehead wrote: > Hi everyone, > > I'm working on a script that downloads archived fax images (TIFFs and PDFs) > from a MS SQL Server using the PDO ODBC driver. I get the below error > regardless of which fax I try to get from the database. Each fax is a > different size, and both of the memory allocation numbers are always the > same: > > Fatal error: Out of memory (allocated 262144) (tried to allocate 4294967295 > bytes) in C:\Inetpub\wwwroot\FMarchive\library\faxInbound.php on line 81 Ho big are those faxes? 4294967295 bytes = 4GB have you tried executing that SQL directly into the database? Does it return the right results? > > The above error happened when querying a fax with a size of 17723 bytes. > According to my phpinfo(); page, the memory_limit is 128MB. > > My machine has the below specs: > Windows Server 2003 SP2 > IIS 6 > 2GB RAM > Microsoft SQL Server 2005 SP2 > PHP 5.2.4 > > Here is the excerpt from my code: > > public function downloadFax($id, $attid, $attsize) > { > try > { > $stmt = 'SELECT filename, attdata FROM fm_faxin_att WHERE id = :id AND > attid = :attid'; $pstmt = $this->db->prepare($stmt); > $pstmt->bindValue(':id', $id); > $pstmt->bindValue(':attid', $attid); > $pstmt->execute(); // this is the Line 81 referenced by the error > message $pstmt->bindColumn('filename', $filename, PDO::PARAM_STR); > $pstmt->bindColumn('attdata', $data, PDO::PARAM_LOB); > $pstmt->fetch(PDO::FETCH_BOUND); > > return array('attdata' => $data, 'filename' => $filename); > } > catch (PDOException $e) > { > die($e->getMessage()); > } > } > > Any ideas? > > Regards, > Carlton Whitehead -- Internet Vision Technologies Level 1, 520 Dorset Road Croydon Victoria - 3136 Australia
Attachment:
pgphTmxKZ2mG6.pgp
Description: PGP signature