Installing libtidy in PHP5 on a CentOS cPanel server

by Phil Dufault on July 26, 2008 · 3 comments

in CentOS,Linux,PHP,Redhat

To install libtidy in PHP5, it’s really quite easy.

Make sure your /tmp directory doesn’t have something like noexec set on it, otherwise this would be more difficult.

Here’s the install command:
pecl install http://pecl.php.net/get/tidy-1.2.tgz

Find where your main php.ini file is:
root@server [~]# php -i|grep php.ini
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini

Add the module to your php.ini:
$EDITOR /usr/local/lib/php.ini

You’ll need to scroll down to the extensions area, I just keep searching for extension till I find it.
Add this line:
extension=tidy.so

Save, and restart your Apache web service:
service httpd restart

Test via phpinfo(); to make sure it’s working.

{ 3 comments… read them below or add one }

Install Php 5 August 7, 2008 at 8:49 pm

Good site I stumbled it today.. looking forward to seeing what else you have..later

Selwyn Polit August 8, 2008 at 8:33 pm

Didn’t work for me. I am trying to install on a Virtual Private Server at Westhost.com. I get the error:

configure: error: Cannot find libtidy

Any suggestions?

Phil Dufault August 11, 2008 at 9:54 am

I’m not sure what you’ve done — you shouldn’t be running ./configure anywhere. Did you follow my steps above?

Leave a Comment

Previous post:

Next post: