Well, I'm bad about documenting this stuff but here is a (very) rough sketch of what I do. I usually install apache to /www or /usr/local/www and compile everything from /user/src/www out of habit. The php config below was from my last compile under Mandrake 8.1
I will typically install with; apache, mm, mod_ssl, openssl, php, curl, zlib, freetds, ct/freetype, xml/wddx, mysql, pgsql and a few others.
I compile mod_ssl built into Apache instead of a dso, plus mods so, rewrite, log referer and a couple others.
I usually find it necessary to put the paths to freetds (and openssl) in ld.so.conf because I tend to install these under /user/local. Don't forget to run ldconfig after adding the entries.
After that I haven't had to spend much time exporting extra LD_LIBRARY_PATHs in awhile though your milage will likely vary depending on the options you choose.
Once Apache is installed and running I compile php with apxs and the various options. The php config will typically look something like:
./configure \ --with-apxs=/usr/local/www/bin/apxs \
--with-mysql=/usr \
--with-pgsql=/usr \
--with-sybase=/usr/local/freetds \
--enable-inline-optimization --with-zlib \
--enable-magic-quotes --enable-track-vars \
--enable-sysvsem --enable-sysvshm \ --with-mod_charset \
--enable-trans-sid --with-dbase --enable-ftp --with-xml --enable-wddx \
--with-gd=/usr --enable-gd-native-ttf --with-dom --with-ttf \
--enable-memory-limits=yes
It's likely you won't want or need more than half of that and it is probably better to config/compile a few times and add more features each time so you can see which libs are going to cause you problems. One of the great things about dso's.
The main problems I've run into with freetds/mssql is that there is a character set setting in the php mssql code that used to have to be removed when using freetds vs the ct-libs. I think this has been fixed in php 4.06 but if you get an error about CHARSET when starting Apache its in ext/mssql/php_mssql.c I just delete that section of code and recompile.
The only other problem I've run into was the syntax of the freetds/interfaces file. It has to have the server information of your mssql servers listed. If the server name doesn't resolve, IPs will work.
Hope this is some small help.
Jerry