HOWTO: Install PHP5 on Linux
I did this on a IBM box running Red Hat Linux, I'm not sure which version. It basically went like a dream, and maybe took an hour or so. This is to compile PHP5 as an Apache module, a way I choose as it makes subsequent PHP upgrades simpler. Everything was installed under /usr/local, for what it's worth.
By way of a disclaimer, do follow the advice with caution. I make no guarantees that this will work for you, or that it won't severely compromise your system, or whatever. Also, note that PHP5 is not yet at a stable release and so you'd be a fool to put this into a production environment. So be careful. Ok, enough chat, let's go!
Update 2004/10/07: PHP is now at version 5.02. We're using it in production here, and everything seem to be going smoothly.
Apache
Firstly you'll want Apache HTTPD up and running. There's enough documentation on that all over the web so I won't linger here, except to point out that since I want PHP as an Apache module, my configure line looks like so:
Secondly there's a whole stack of libraries to get hold of and install. I may have overdone it but I wanted to make sure I had the lot. All versions were the latest available at the time, unless otherwise stated.
Zlib
These are the compression libraries on which PHP is built, so they're fairly important. Zlib is available from http://www.gzip.org/zlib/.
Libiconv
Details available from http://www.gnu.org/software/libiconv/.
Libxml2
Libxml2 is the core of PHP5's greatly improved XML processing. Downloads page: http://www.xmlsoft.org/downloads.html. Put the kettle on: this is one of the lengthier builds, as it's pretty large bundle to compile.
Libxslt
We won't be seeing Sablotron in PHP5 for some time, so we're using libxslt, which is much faster anyway. This is also from xmlsoft.org.
Ming (0.3b)
Ming is a very powerful, but still rather experimental library which allows you to generate SWF (Flash) format files. At the time of writing the latest version was 0.3b which compiled pretty well (although the bundled INSTALL instructions are entirely misleading). There's no autoconf for this one, so just make and make install straight off. The one gotcha was that make install seems to want to install a file that does not exist - hence the mv line.
GD
For dynamic image generation. Details from http://www.boutell.com/gd/. Recent PHP support for GD now makes installation a breeze, though in order to do anything useful, you'll require at least the following libraries.
libjpeg
libpng
http://libpng.sourceforge.net/. Slightly odd this one, so take care. There's no configure but you need to make sure you get the right makefile for your system.
PHP
And finally configure and install PHP itself. At the time of writing PHP version 5.0.3 is the latest. I'll try to update this page for subsequent releases, but no promises.
The PHP install takes the liberty of reconfiguring your Apache for PHP5. I'm not sure I'm entirely comfortable with that idea, but it seems to work. You may need to restart your httpd though, and like the installer says, you might choose to add /usr/local/lib/php to your include_path in php.ini.