CentOS / RHEL: Install php-tidy Module / Extension

www.la‮.iruttu‬com
CentOS / RHEL: Install php-tidy Module / Extension

To install the php-tidy module (extension) on a CentOS or Red Hat Enterprise Linux (RHEL) system, you can follow these steps:

  1. Install the 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.

  1. Enable the 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.

  1. Restart the PHP-FPM service to apply the changes:
sudo service php-fpm restart

This will restart the PHP-FPM service and load the tidy extension.

  1. To verify that the 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 the php-tidy module for more information on how to use these tools.

Created Time:2017-10-16 14:38:41  Author:lautturi