Yash Malik
Yash Malik

Reputation: 11

TCPDF Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 25368 bytes)

I am using the TCPDF library to simultaneously download pdf's onto my local drive.

PHP CODE:

$text = //an array of id's
$id = explode(',', $text);
for ($i=0;$i<count($id);$i++){
    if(//id[$i] exists in database){
           createPDF($id[$i],'test123','F');
    }
}

createPDF is where the tcpdf library is used to create pdf's.

This works, and the first few pdf's are generated, but soon enough, I get an error saying:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 25368 bytes)...

Is there a way I could fix this? or is it a tcpdf bug?

Upvotes: 1

Views: 3180

Answers (1)

Santosh Yadav
Santosh Yadav

Reputation: 21

In this case please increase the memory limit for the script through the ini_set() function.

Upvotes: 2

Related Questions