PHP tidy extension is loaded but not working

13 02 2009

The other day we had trouble getting PHP tidy to work on Red Hat Fedora Core 9. Especially frustrating was that we would get an error message like this one:

Fatal error: Class ‘tidy’ not found in Path/to/file.php on line 9

And of course this is made worse by the fact that extension_loaded(“tidy”) shows that the Tidy extension is loaded! So the Tidy extension being loaded, but the class not existing was a bit puzzling to say the least.

The long and short of it was that we came up with this methodology for setting up the tidy extension on Red Hat:

  1. Run commad pecl install tidy to get the latest version of tidy
  2. Run yum install libtidy to get the lib that the extension depends upon
  3. Add the line extension=tidy.so to your php.ini (or a create a tidy.ini in your php extensions ini folder – possibly /etc/php.d/)
  4. Run yum install php-tidy to install the extension that get tidy.php working together (This is probably the step that is missing if you are getting the above error)
  5. Restart apache:  /etc/init.d/httpd graceful on our system

And that was all there was to it! Not a very exciting blog post, but hopefully useful to someone :)

Advertisement

Actions

Information

2 responses

21 04 2009
Marc

Ah ha! Didn’t know I needed to “yum install php-tidy”. Solved my problem. Thanks for posting this.

22 04 2009
Fatal Error: Class ‘tidy’ not found « Different.In a good way

[...] php tidy extension loaded but not working [...]

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

Please log in to WordPress.com to post a comment to your blog.

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s




Follow

Get every new post delivered to your Inbox.