I want to setup the W3C fork of HTMLTidy (tidy-html5) as a PHP extension.
I had installed the normal php/tidy extension using the php5-tidy
package.
I then downloaded the Git repository, and ran the following commands to compile the shared library:
sh build/gnuauto/setup.sh && ./configure && make
sudo make install
After restarting the php5-fpm service, I still see the same tidy information on phpinfo()
:
libTidy Release 25 March 2009
Extension Version 2.0 ($Id$)
Shouldn't the PHP extension start using tidy-html5
at this point? What can I do to make it work?
As I understand tidy-html5 is not a php module, so you can't use it directly with php. It's just a command line tools and/or shared library. You could try to build php with the new shared library
One example how I use Tidy from within PHP:
With:
you can test if you have a command line tidy available. Formerly the HTML5-compatible version from Github had HTML5 in the version text, now it just says 'HTML Tidy for Linux version 4.9.18' but I think that's enough to work with (for example if you want to differentiate between HTML5 compatible and basic tidy).
Another option:
Unfortunately, I'm not ubuntu/debian expert (As I see you have used apt). On RHEL based system I just download and install http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/SRPMS/php53u-5.3.26-2.ius.el6.src.rpm, edit /root/rpmbuidl/SPESC/php53u.spec and rebuild rpm package
As far as I know, on debian you can rebuild package too. Something like