MacFreak -
generally, you use the --prefix argument when configuring a program. for example, to set up apache (httpd) in a new folder at the top level called www, you would do something like this.
(while in the apache source/binary directory)
$ ./configure --prefix=/www
another usual one is
$ ./configure --prefix=/usr/local/apache
or some such thing. same with mysql and php. just go to the configure scripts (within the proper directory) and use the prefix argument.
when installing php with apache, you need to know the directory of where you are. you can always use the command 'pwd' to Print the Working Directory (where you currently are).
example:
my apache is in my root download folder which i made, so when i 'pwd' in that directory, it prints this out
$ pwd
/private/var/root/downloads/apache-1.3.12
so with php i would do this
$ ./configure --with-apache=/private/var/root/downloads/apache-1.3.12
and then add whatever else needs to be there.
hope this helps