If you’re like me, you need to run both PHP4 and PHP5 on the same computer, at the same time. If you’re installing PHP from source, this is pretty easy, as you can use the "–prefix" option to install each version into a different location. So, for example, I install PHP4 into /usr/local/php4, and PHP5 into /usr/local/php5.
However, I recently had problems with getting tidy to work with this setup. With Demian’s help, however, I have the answer:
- Download the libtidy source (tidy_src.tar.gz) from
http://tidy.sourceforge.net/ . - Put it into /usr/local/src (for example), and untar.
- Go into the untarred library’s /build/gmake/ directory.
- Run ‘gmake’, and ‘gmake install’.
- Check that ‘/usr/local/lib/libtidy.a’ exists. This is the default install for libtidy.
Now, you need to install tidy for each version of PHP. For PHP4:
- Recompile and install PHP4 using the ‘–
with-tidy =/usr/local’ option. - Download the PECL tidy source from http://pecl.php.net/package/tidy. At present, you want version 1.1.
- Put it into /usr/local/src (for example), and untar.
- Run ‘phpize’ – ensure you use the PHP4 version of phpize, so, /usr/local/php4/bin/phpize, for example.
- Run ‘./configure; make; make install’.
- The extension (tidy.so) will have been placed in /usr/local/lib/php/extensions/
no-debug-non-zts-20020429 /. If, like me, you have installed PHP4 elsewhere, you will need to move the file to the corresponding location in your real PHP4 install (e.g. /usr/local/php4/lib/php/extensions/no-debug-non-zts-20020429 /). - Add ‘extension=tidy.so’ to your PHP4’s php.ini file.
The installation of tidy for PHP5 is much easier:
- Recompile and install PHP5 using the ‘–
with-tidy =/usr/local’ option.








October 5th, 2005 at 3:23 pm
Easier with FreeBSD and the ports system ( http://www.freebsd.org/cgi/ports.cgi?query=php5-tidy&stype=all ).
$ cd /usr/ports/www/php5-tidy
$ make
$ make install
and you’re done.
btw, i don’t think you have to recompile PHP5 to add an extension.
October 7th, 2005 at 12:38 pm
http://www.phpkitchen.com/index.php?/archives/727-Installing-Tidy-on-PHP-4-and-5.html
| Comments
If you’re like me, you need to run both PHP4 and PHP5 on the same computer,
at the same time. If you’re installing PHP from source, this is pretty ea
October 8th, 2005 at 7:45 pm
I’ve come to believe almost all the linux distros are better suited for installing software then red hat, most certainly debian and freebsd.
October 11th, 2005 at 1:38 pm
If you’re like me, you need to run both PHP4 and PHP5 on the same computer, at the same time.
October 17th, 2005 at 2:33 pm
Hello,
does anybody know if it’s possible to run tidy on php4.3.11 on a windows system. this with apache2. I cant get it to work. I think wrong dll but there is no place to download the right one..
I would be very happy if someone could help me out..
Thanks in advance.
Stefan
December 29th, 2005 at 1:33 pm
Hi,
I have the following problem:
I am trying tidy with php5 running in cgi-wrap, as indicated by this article on pair support.
http://www.pair.com/support/knowledge_base/authoring_development/system_cgi_php-cgiwrap.html
PHP5 runs fine this way, but the executable is not compiled with tidy (tidy isn’t mentioned when I run phpinfo()).
Is there a way to get tidy included still?
I tried
php_value tidy.default_config /usr/..path../tidy/
in .htaccess , but that didn’t work.
Thanx in advance!