I dug around a bit, but most resources I came across on Google were about using the tidy extension for PHP rather than doing a custom build of PHP that included the tidy extension. Once I figured the details out, I thought I’d share. They admittedly seemed somewhat obvious after the fact, though also were not communicated as explicitly as I would have liked anywhere that I could see.
You’ll need a system with a CVS client installed to do this. The system I intended to build on didn’t have one, so I used my laptop, did a CVS checkout, made a gzipped tarball out of the CVS checkout directory, used scp to push it up to the remote server, and decompressed and extracted the archive from there.
- Download a PHP 5.3.0 tarball and decompress it.
$ wget -c http://us2.php.net/get/php-5.3.0.tar.gz/from/a/mirror $ tar -zxf php-5.3.0.tar.gz
- Follow the anonymous checkout instructions to download tidy. Enter the first command shown here, press Enter without entering anything when prompted for a password, then enter the second command shown here.
$ cvs -d:pserver:email@example.com:/cvsroot/tidy login Logging in to :pserver:firstname.lastname@example.org:2401/cvsroot/tidy CVS password: $ cvs -z3 -d:pserver:email@example.com:/cvsroot/tidy co -P tidy
- When configuring the PHP build and specifying the path for tidy, just point to the root CVS checkout directory.
$ ls tidy CVS CVSROOT bin build console experimental htmldoc include lib src test $ cd php-5.3.0 $ mkdir build/php_build $ ./configure --prefix=`pwd`/build/php_build --with-tidy=../tidy $ make $ make install
I didn’t run into any problems when following this process. php -m shows the tidy module and it appears to run without issue. Hope this helps someone else.