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:
- Run commad pecl install tidy to get the latest version of tidy
- Run yum install libtidy to get the lib that the extension depends upon
- 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/)
- 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)
- 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
Ah ha! Didn’t know I needed to “yum install php-tidy”. Solved my problem. Thanks for posting this.
[...] php tidy extension loaded but not working [...]