Tuesday, September 2, 2008

How To Install PHP Tidy on Fedora 9

How To Install Tidy on Fedora 9

What is Tidy?

Tidy is fundamentally a tool that reads in HTML cleans it up and writes it out again. It was developed as a program you run from the console prompt, but there are GUI encapsulations available, e.g. HTML-Kit, which you might prefer.

Tidy is a standard PHP module provides tidy library support. Tidy is currently available for PHP 4.3.x and PHP 5 as a PECL extension. Tidy can easily be installed to Fedora OS.

Tidy Installation on Fedora 9

The hard way to install tidy is by manual installation, which was based from PHP site here. The below code is a sniff copy from it taken from PHP tidy help site:

gunzip tidy-xxx.tgz

tar -xvf tidy-xxx.tar

cd tidy-xxx

phpize

./configure && make && make install




Alternatively, fedora repo supports tidy rpm, and can easily be installed using yum installer.

Step One


To install PHP Tidy module and tidy shared libraries for fedora, simply

# yum -y install libtidy.i386

# yum -y install php-tidy.i386


The default PHP-tidy conf file would be pointed to /etc/php.d/tidy.ini with a tiny library file to /usr/lib/php/modules/tidy.so .

To install tidy for Fedora as a stand alone terminal component, simply

# yum -y install tidy

If you want to use tidy with python, optionally you can install tidy phyton wrapper like so

# yum -y install python-tidy.noarch

and for perl programmers that makes use of tidy, simply install tidy perl tools

# yum -y perltidy.noarch

# yum -y perl-HTML-Tidy.i386


There is no need to edit php.ini for tidy to properly work. However, for PHP tidy reference, the default tidy configuration file set inside /etc/php.ini is currently pointed to

/usr/local/lib/php/default.tcfg

which does not bother my need at all.

More PHP TIdy info can be read here.

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy