Fatal error Class 'tidy' not found with Wamp + PHP 5.5.12

0

In a project I'm working on at my current job, I came across some issues that really are giving me headaches:

Follow line of code from file TransformDoc.inc.php

public function validatorXHTML()
{

    ob_start();
    ?>
    <html>a html document</html>
    <?php
    $html = ob_get_clean();

    // Specify configuration
    $config = array(
               'indent'         => true,
               'output-xhtml'   => true,
               'wrap'           => 200);

    // Tidy
    $tidy = new tidy; //Linha 315(ERRO)  
    $tidy->parseString($html, $config, 'utf8');
    $tidy->cleanRepair();

    // Output
    echo $tidy;

}

Line 315:

  

$ tidy = new tidy;

    
asked by anonymous 28.10.2016 / 17:17

1 answer

0

Let's assume you are using Wampserver 2.0. With it already open (running) you only have to follow this path and right-click the Wamp Server icon in your system tray > PHP > PHP extensions & php_tidy , as shown in figure:

Once this is done, the class will be enabled in PHP.ini

If you have any questions, please do not hesitate to ask.

abs

    
28.10.2016 / 17:17