To install the php-tidy
module (extension) on a CentOS or Red Hat Enterprise Linux (RHEL) system, you can follow these steps:
php-tidy
package using the yum
package manager:sudo yum install php-tidy
This will install the php-tidy
package and any dependencies that are required.
tidy
extension in the php.ini
configuration file by adding the following line:extension=tidy.so
You can find the location of the php.ini
file by running the following command:
php --ini
This will show the path to the php.ini
file that is being used by PHP.
sudo service php-fpm restart
This will restart the PHP-FPM service and load the tidy
extension.
tidy
extension is installed and enabled, you can use the phpinfo()
function in a PHP script. For example, create a file called info.php
with the following contents:<?php phpinfo();
Then, run the script by accessing it in a web browser:
http://localhost/info.php
This will display the PHP information page, which includes a list of installed extensions. The tidy
extension should be listed under the "Core" section.
Note: The
php-tidy
module (extension) provides support for the Tidy HTML clean and repair utility in PHP. The Tidy library can be used to parse and fix HTML and XHTML documents. Consult the documentation for the Tidy library and thephp-tidy
module for more information on how to use these tools.