Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Tidy, PHP

Tags:

php

tidy

I guess when php was installed on my box --with-tidy arg was not included.

When browsing my php.ini the line:

;extension=php_tidy.dll

is missing.

How can I add the module to my php install? Note I tried adding:

extension=php_tidy.dll

but with no luck.

I checked the docs but all they say is:

This extension is bundled with PHP 5 and greater, and is installed using the --with-tidy configure option.

like image 363
KyleT Avatar asked Jun 28 '10 00:06

KyleT


2 Answers

On Ubuntu, you can add tidy to your php5 installation by running this command in a terminal:

$ sudo apt-get install php5-tidy

If you want to check if it is already installed or validate that the command above worked:

$ php -i | grep libTidy
libTidy Release => 25 March 2009 // means tidy is installed

To install both php5 and tidy at the same time, use this command (as an alternative to the "--with-tidy" configuration option):

$ sudo apt-get install php5 php5-tidy
like image 77
Joe Fernandez Avatar answered Nov 20 '22 08:11

Joe Fernandez


For PHP 7 just run

sudo apt-get install php-tidy

And restart Apache, That's it :)


Update: Thanks to @Arnis Juraga

For the version above PHP 7, you can mention the version code as follows.
apt-get install php7.4-tidy

like image 10
Samy Massoud Avatar answered Nov 20 '22 06:11

Samy Massoud