Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Help with Tidy support in PHP5

Help with Tidy support in PHP5
Thread Tools
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 18, 2004, 01:16 AM
 
Hi,

I am trying to get PHP5 installed with Tidy support. PHP5 comes with the tidy extension build in, you just have to add it when doing ./configure. I did:

./configure --with-tidy

I got PHP5 installed, and phpinfo() returns a page saying the tidy extension is installed and running. Before I compiled and installed PHP5, I installed libtidy into /usr/lib.

This did not work. When I try some tidy examples in PHP, no data is returned. So then I tried removing libtidy and putting it into the default location when configuring (/usr/local/lib/) Still does the same thing.

If anyone could give me step by step directions or any help at all, I would very much appreciate it!

Thanks!
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 18, 2004, 01:31 AM
 
Oh, here is the PHP code that is not working:


<?

$html = "<html><head><title>test</title></head><body><p>error</i></body></html>";

$cleanHTML = tidy_repair_string($html);

echo $cleanHTML;

?>


Also... I'm thinking the tidy extension, or PHP, or Apache, or whatever may not be able to access the libtidy library for some reason. They are those dylib libraries or whatever...
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Nov 18, 2004, 01:12 PM
 
Ok, I found I had gotten libtidy installed correctly and linked up with PHP5. The problem is tidy_repair_string() is not working, with tidy_parse_string() is.

Any ideas?

Thanks!
     
Grizzled Veteran
Join Date: Jun 2001
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Nov 18, 2004, 04:15 PM
 
Originally posted by timmerk:
Ok, I found I had gotten libtidy installed correctly and linked up with PHP5. The problem is tidy_repair_string() is not working, with tidy_parse_string() is.

Any ideas?

Thanks!
If you're using PHP5 you may want to interpret the string in the OO-way:-

(from http://www.php.net/manual/en/functio...ean-repair.php)
Code:
<?php $html = '<html><head><title>test</title></head><body><p>error</i></body></html>'; $tidy = tidy_parse_string($html); tidy_clean_repair($tidy); echo $tidy; ?>
Computer thez nohhh...
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2