Forum


Replies: 1   Views: 562
Timeout running doc from template
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 cem  · 21-04-2023 - 16:09

Hi,

We have Enterprise/premium version and when looping through a set of data from a MySQL database, we have the application just timeout.  I sometimes get an error message, but often the screen is just white.  The process works through about half of the list and seems to always timeout at 5mins/300 seconds.  I have checked the config files for Codeigniter platform we use, php ini files, mysqsl timeout, iis timeout, browser timeouts and were already set above 300 or changing the settings did not work.

When we do manage to get the error on screen it is this:

Fatal error: Maximum execution time of 300 seconds exceeded in serverpath\classes\DOMPDF_lib.php on line 3483. 

We are using the class CreateDocx() only so not sure if that calls the pdf library but we are outputting to a .docx only.  Is it safe to update that file?  Is there anywhere else i can check? 

Thanks for any help or suggestions!

Renee

Posted by admin  · 21-04-2023 - 18:19

Hello,

DOMPDF_lib.php is an internal class used to parse HTML/CSS contents by HTML methods (embedHTML and replaceVariableByHTML). It is updated each new release of phpdocx to support new HTML tags and CSS styles, and also other improvements.

A Fatal error: Maximum execution time is a PHP error that appears when a PHP script exceeds this PHP time setting. You can set an unlimited value in your PHP code:

ini_set('MAX_EXECUTION_TIME', '-1');
set_time_limit(0);

or in the PHP configuration.

On https://stackoverflow.com/questions/7680572/fatal-error-maximum-execution-time-of-300-seconds-exceeded you can read more information about this question.

In any case, we recommend you test it running PHP CLI mode, maybe you are transforming a huge HTML/CSS or there's any external blocking such as the database or a web service. Although huge HTML/CSS contents are supported, on https://www.phpdocx.com/documentation/cookbook/convert-html-to-word you can read some recommendations to improve the performance when transforming HTML/CSS.

If you send to contact[at]phpdocx.com a sample script using phpdocx standalone (this is without external resources such as frameworks, CMS, web services or databases), we can check and run it. If you send this sample script, please note that we need to run it changing only the path to include phpdocx classes.

Regards.