It could be useful to provide instructions about the compilation of the 3. I also have a problem with mysqli and will need to compile php5... Any help will be appreciated, like your experience ! :-)
As the repos don't contain mysql5 it's mandatory to compile.:(
Php5 is in the repos but it doesn't have support for mysqli so it's fairly useless.:(
Apache is in the repos and is ok, but he depends on php5 wich we don't want to use the provided one.:(
It seems that the stars don't want us to do that!:-k
Maybe there's a more simple way, but i just compiled everything.
Apache should be easy and the web is full of tutorials on this. Just keep in mind that you need php5 support (you may want it trough mod-php5).
Php is easy as well, very documented, just try to compile all the libs you'll need with it. here's my configure options if you need an exemple
'./configure' '--prefix=/usr/local/php5' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-libxml-dir=/usr/local/lib' \
'--with-zlib' '--with-zlib-dir=/usr/local/lib' \
'--with-mysqli=/usr/local/mysql/bin/mysql_config' \
'--with-mysql=/usr/local/mysql' '--with-mysql-sock=/tmp/mysql.sock' \
'--with-gd' '--enable-soap' '--enable-sockets'
Chances are that you'll need zlib and libxml support (you realy should compile them into php5). But this extensions don't come bundled in php5. Just download each in it's own site, compile it, and use the option above to link it. Don't forget to add the '--with-mysqli=PATH_TO_mysqli_config' flag so you have mysqli support. There are many tutorials on web and it should be easy to get the job done.
Mysqli5 in the trickiest. Mysqli documentation on compiling is poor, there's some tutorials out there, but they're all missing something. So you're free to ask here.
Remember that this tutorial would see some improvements I never had time to test and update. But they're all discussed in this thread.:-D
Good luck