Replies: 13   Views: 4292
Very slow / maximum execution time addtemplatevariable with table of >50 rows
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by m.elfring  · 18-11-2011 - 10:41


When i use phpdocx to create documents from a template that contains a table, the generation is very (too) slow.
I've tried using a very clean template (just containing a table) but nothing seems to help.
When the query (i run against a database to get the content of the table) returns more than say 50 rows most of the time the script stops: Maximum execution time of 60 seconds exceeded in /var/www/html/changes/phpdocx/classes/ on line 1248

My code:

$docx = new CreateDocx();

Get data from an table in an oracle database:
oci_fetch_all($q, $rows, null, null, OCI_FETCHSTATEMENT_BY_ROW);

Add the data to the document:
$docx->addTemplateVariable( $rows, 'table', array ( 'header'=> true) )

I've tried several table's, using more or less columns, nothing seems to help.

Could you advise?

Marcel Elfring