I have experience installing PHP4 and 5 from source. The best bet is to run the standard configure make and install if you're starting out
./configure
make
make install
Note: Most errors are going to come in the ./configure part of the process, usually in the form of "error: cannot find (insert library here)". In which case, you'll have to either specify manually (--with(insert library here)-path="(full path to lib folder)") or do without (using --without-(insert library here))
In any case, typing
./configure --help | less
should give you some help.
And if all fails, head to
www.php.net and RTFM.