install tidy on ubuntu 20.0.4 for PHP 8.1
sudo apt-get install php8.1-tidy
This extension is bundled with PHP 5 and greater, and is installed using the --with-tidy configure option.
PHP 4 users may use the (old) PECL extension here: » http://pecl.php.net/package/tidy.
Note:
Tidy 1.0 is for PHP 4, whereas newer versions of the Tidy extension are for PHP 5 and greater.
install tidy on ubuntu 20.0.4 for PHP 8.1
sudo apt-get install php8.1-tidy
On Redhat-ish linux, you must install both libtidy and libtidy-devel (PHP 5.x):
sudo yum install libtidy libtidy-devel
On Ubuntu 17.10 and php 7.1:
sudo apt install libtidy-dev libtidy5 php-tidy