for slackware 10.2 users with apache2, mysql5, and trying to install php5:
when following the directions above, after this step:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
i kept getting this error:
"Unable to find MySql header files...."
the only way i could get php5 with mysql support was to compile MySql5 from source, and not use the binary as the mysql site recommends.
then i was able to ./configure successfully, but for some reason php was configured to compile the CGI version.
so, had to use this ./configure line:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --disable-cgi
alternatively, you could install php4 which does bundle the MySql client files.