ok, got it.
There seems to be a problem with using the internal MySQL config, so you need to get it from an external source. Here's what I did:
First thing I did was "make clean", "make distclean" in the PHP directory (I first tried compiling without doing "make clean" and "make distclean" and it didn't work). I then downloaded the latest source from mysql.com and decompressed it into /usr/src/mysql-3.23.54a-pc-linux-i686
My PHP configuration looked like this:
./configure
--with-apache=/usr/src/apache-1.3.27
--with-config-file-path=/wwwroot/php
--with-mysql=/usr/src/mysql-3.23.54a-pc-linux-i686
--with-pear
--with-xml
--enable-bcmath
--enable-calendar
--enable-ftp
--enable-magic-quotes
--enable-sockets
--enable-track-vars
(/wwwroot is the directory where I install apache, which I then compiled with ./configure --prefix=/wwwroot --activate-module=src/modules/php4/libphp4.a --enable-module=so)
You should be able to enter anything you want in your PHP config, just make sure that "--with-mysql" has the "=[/path/to/mysql]" on the end of it.