I don’t know that there is any really good documentation for compiling and installing PHP… but I can tell you how I did it…
basically you need to install PHP as a CGI. so look for instructions on how to do that. the key I think is to create a local set of the unix standard directories (bin, etc, man, lib, et. al) in your home directory so that you can write everything there (and making sure you include that in your unix path)
the other hard part is figuring out what modules of php you need installed to run horde. look at the INSTALL files in each of the horde modules that you want to use, and they will tell you what PHP modules you need.
Then you just have to download php and all of the required modules, compile all of the modules and then make and compile PHP.
Compiling things with *nix is pretty easy because everything you need comes with a set of makefiles so basically you follow the same steps for everything. first you do a ./configure with all of the options you want, then you do a make and then you do a make install
Let me know if you need more help, I can try to write down what I did step by step and hopefully you will be able to get it to work.
I don’t know that I did it in the best way, but I know that what I did work. Maybe if I post the steps here, someone who is more knowledgeable than I am can take a look at it and let me know if there is a better way to do it.