Re: Tidy 1.0 problems
| From: | Kaspars Foigts | Date: | Mon, 08 Mar 2004 07:29:54 +0000 |
| Subject: | Re: Tidy 1.0 problems | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-456@lists.php.net to get a copy of this message | ||
So far I have found the real (hopefully) reason why my precious (apache)
goes away with segfault.
There are four files:
Configuration file for Tidy: http://laacz.lv/tmp/tidy/test.cnf. I guess hard
line is "clean: 1", because, when this line is removed, everything works
well (but html is not cleaned up).
Input file, which is being cleaned upp well:
http://laacz.lv/tmp/tidy/test.txt (encoding is
utf-8)
Input file, which causes segfault: http://laacz.lv/tmp/tidy/test-fault.txt
(encoding is utf-8)
And PHP source file: http://laacz.lv/tmp/tidy/code.phps
Hope this helps in solving the problem...
"Kaspars Foigts" <laacz@laacz.lv> wrote in message
news:20040308055902.21499.qmail@pb1.pair.com...
> Hello!
>
> I recently started using Tidy both on Linux (RedHat) and win32
systems.
> On
> Linux I installed it as part of PHP (by rebuilding configure with
> buildconf), for
> Windows system I fetched latest php_tidy.dll from
> http://snaps.php.net/win32/PECL_STABLE/
>
> Well, I got one issue I could not find solution for. Apache does
> segfault when
> I am trying to do tidy_clean_repair() more than once.
>
> Here goes sample PHP code:
>
> <?php
> tidy_set_encoding('utf8');
> // I guess it will react the same without these setopts's
> tidy_setopt('show-body-only', 1);
> tidy_setopt('output-xhtml', 1);
> tidy_setopt('word-2000', 1);
> tidy_setopt('clean', 1);
> tidy_setopt('drop-empty-paras', 1);
>
> tidy_parse_string($lead);
> tidy_clean_repair();
> tidy_get_output();
>
> tidy_parse_string($content);
> tidy_clean_repair();
> $content = tidy_get_output();
> ?>
>
> Because this takes place on different operational systems I guess
> configuration
> of them is not necessary.
>
> --
> Kaspars Foigts
> http://laacz.lv/