PDOStatement execute memory issue?



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

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
.



Relevant Pages

  • Re: Object Explorer Error on both boxes
    ... Again I appreciate the help Geoff. ... meaning we've already got SP2 on our cluster. ... >> Senior SQL Infrastructure Consultant ... >> Microsoft SQL Server MVP ...
    (microsoft.public.sqlserver.clustering)
  • Re: MASSIVE DTS bug introduced with XP SP2
    ... The original DTS package was using a Source ... XP SP2 box every time, and work beautifully on my XP box ... Have fun. ... >Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) ...
    (microsoft.public.sqlserver.dts)
  • Re: Object Explorer Error on both boxes
    ... Microsoft SQL Server MVP ... connecting to a cluster with Object Explorer from SSMS, however, no answer is ... node failover cluster that we recently upgraded to 2005. ... All my research has been that this would be addressed in SP2. ...
    (microsoft.public.sqlserver.clustering)
  • Re: Cant start mirroring
    ... i re-installed evryting and forgot SP2 ... Now it seems to work, but when I try to start mirroring, I get another ... (Microsoft SQL Server, error: 1418) ...
    (microsoft.public.sqlserver.setup)