This installation of PHP will need some extra features, like maybe SOAP or XML functionality. For XML you need libxml2-dev. On a Debian machine this can be installed with:
# apt-get install libxml2-dev # apt-get install openssl libssl-dev
Even if you already had that library, it wouldn't hurt to see if it has an upgrade available.
cd into the php directory:
$ cd ../php-5.1.2
Configure PHP with GD, XML, OpenSSL .. and more!
$ ./configure \ --with-apache=../apache_1.3.34 \ --with-mysql=/usr/local/mysql \ --with-gd \ --with-jpeg-dir \ --enable-jpeg \ --with-xml \ --with-zlib=/usr \ --with-mcrypt \ --with-dom-xslt \ --with-dom-exslt \ --enable-gd-native-ttf \ --with-ttf \ --with-openssl \ --enable-ftp \ --enable-png \ --enable-soap
If you get an error, it's most likely you are missing some development libraries. If you get a "Thank you for using PHP." message, you can continue...
# make # make install # cp php.ini-dist /usr/local/lib/php.ini