Forum


Replies: 1   Views: 1856
How do i install tidy for xampp and how do i make sure that it also works when i upload the webpage
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 philip0908  · 10-05-2022 - 23:17

I want to use the replaceVariableByHTML-method and apparently it needs a thing called "Tidy". I tried to set the setting

"forceNotTidy"

to "true" and that worked. However, it did not work with "<ul>" and "<li>" elements so I thought that might have something to do with Tidy. I don't know what it does exactly but I enabled Tidy in the "php.ini". That produced the following error:

Warning: PARSERHTML::_load_html(): Unable to load Tidy configuration file at '/usr/local/lib/php/default.tcfg'. in C:\Users\User\Dropbox\Entwicklung\root\phitCMS\features\phpdocx\classes\DOMPDF_lib.php on line 2660

Warning: tidy_parse_string(): Unable to load Tidy configuration file at '/usr/local/lib/php/default.tcfg'. in C:\Users\User\Dropbox\Entwicklung\root\phitCMS\features\phpdocx\classes\DOMPDF_lib.php on line 2688

What exactly do I have to do? Is there a way to download that, put it in a certain folder and tell phpdocx where that very folder it? That way I can make sure that it will also work online and not only on localhost?

Posted by admin  · 11-05-2022 - 05:19

Hello,

Tidy is a PHP extension (https://www.php.net/manual/en/book.tidy.php) used by phpdocx to fix wrong HTML, handle CSS styles correctly and other tasks when importing HTML. It works in the same way with all HTML contents and CSS styles, so if you only have issues enabling forceNotTidy with list tags, maybe you are using not supported contents or styles or you are doing an type inline replacement instead a block type replacement (https://www.phpdocx.com/api-documentation/templates/replace-variable-html-Word-document). On the HTML API documentation you can read all HTML tags and CSS styles supported and samples. 
In any case, enabling PHP Tidy is highly recommended.

About your question, please note that it's not a phpdocx issue but a PHP one and the solution depends on how you have installed PHP. Please check the following link: https://community.apachefriends.org/f/viewtopic.php?p=112503, maybe you can disable that setting in the PHP configuration or change its path to the correct one. If you are using a Windows server you can't use a UNIX path to point files.

Regards.