Install Tidy, PHP
Asked Answered
L

6

18

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.

Libration answered 28/6, 2010 at 0:27 Comment(1)
I'd assume you either supply php_tidy.dll or compile php --with-tidy alltogether. I might be wrong thoughPodesta
B
6

I was having the same trouble, and wrote up my solution here:
Installing Tidy 2.0 PHP extension on Ubuntu 10.10
http://web.onassar.com/blog/2010/11/16/installing-tidy-2-0-php-extension-on-ubuntu-10-10/

It works on newer versions of Ubuntu as well.
While it may not be the most direct route, it works well.
I hope it helps others.

Bellicose answered 11/2, 2013 at 0:25 Comment(3)
This should work for ubuntu these days: sudo apt-get install php5-tidyCorrade
/*install php5-tidy. Example (for Debian and all:),*/ sudo apt-get install php5-tidy ; /*relaod apache 2*/ : sudo service apache2 reloadEcthyma
I found this answer resulted in errors on the make step.Bondie
H
18

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
Hermaherman answered 13/8, 2014 at 21:53 Comment(2)
The apt was good, work fine, but how to enable? php -i show nothing.Waddle
Hi, the 2017 problem: apt install php7.1-tidy for PHP 7.1... It is not php7.0-tidy (!). The apt and php -i say nothing about that you try to use wrong version.Waddle
B
10

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

Blade answered 4/3, 2017 at 15:49 Comment(2)
E: Unable to locate package php-tidy EDIT: never mind me, PHP needs to be installed first obviously :)Abreaction
For php7 versions, run apt-get install php7.4-tidy and phpenmod tidyUnseam
B
6

I was having the same trouble, and wrote up my solution here:
Installing Tidy 2.0 PHP extension on Ubuntu 10.10
http://web.onassar.com/blog/2010/11/16/installing-tidy-2-0-php-extension-on-ubuntu-10-10/

It works on newer versions of Ubuntu as well.
While it may not be the most direct route, it works well.
I hope it helps others.

Bellicose answered 11/2, 2013 at 0:25 Comment(3)
This should work for ubuntu these days: sudo apt-get install php5-tidyCorrade
/*install php5-tidy. Example (for Debian and all:),*/ sudo apt-get install php5-tidy ; /*relaod apache 2*/ : sudo service apache2 reloadEcthyma
I found this answer resulted in errors on the make step.Bondie
H
2

Put that line in php.ini next to the other extension=...dll lines and make sure php_tidy.dll is in the directory configured in php.ini under extension_dir.

Heliotaxis answered 28/6, 2010 at 0:47 Comment(1)
Where could one get that php_tidy.dll (except compiling it from source)?Amund
H
2

In ubuntu: you need to run the following command in terminal

sudo apt-get install php5-tidy

and the restart the server

sudo service apache2 restart.

Hangman answered 23/9, 2015 at 19:27 Comment(1)
Or with systemd: systemctl restart apache2.Ptolemy
G
1

For those who are having trouble enabling Tidy extension for PHP (using PHP handler for Apache server) on Windows (WAMP server), please note that you may be editing the wrong php.ini file. Assuming that WAMP server is installed in C:\wamp[ver]\ where [ver] is a variable version number.

File that you're probably editing:

C:\wamp[ver]\bin\php\php[ver]\php.ini

File that you must edit:

C:\wamp[ver]\bin\apache\apache[ver]\bin\php.ini

You also might want to make sure what's the correct php.ini file to edit by creating an info php file and add this code to it:

<?php phpinfo();

Then look for Loaded Configuration File string.

Finally make sure you uncomment this line within the correct php.ini file:

extension=tidy
Gamesmanship answered 22/11, 2020 at 23:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.