I use to compile MySQL with --prefix=/soft/MySQL before trying to compile Apache with-mod_php under --prefix=/soft/Apache and --prefix=/soft/Php.
I've got the same problem with something like:
"..cannot find header files under /soft/MySQL"
BUT! When I try to compile with the option "--with-mysql" only, I mean without any path, Php use his own libraries and it works! Except that it give you a message saying that you can't use others modules like mod_perl or mod_auth, thing that is not possible in my case...
Also, I discovered later that MySQL has put his socket under /soft/MySQL/tmp/ on my demand and that Snort want it under /tmp/ .
So I decided to create a symlink under /tmp/mysql.sock pointing to /soft/MySQL/tmp/mysql.sock, and that trick fool Snort like expected...
All of this just to say that on my surprise, when I decided to try again this morning to compile Apache with mod_php, I noticed first that each time you do a ./configure for PHP, you have to clean everything because it cache your first --with-mysql=<path>. I used to delete all the structure of php and untar the source file again.
As soon as my MySQL was running, with the socket under /tmp/mysql.sock and as soon as I cleaned all the structure and do a fresh ./configure --with-mysql=/soft/MySQL, I got this:
checking for MySQL support... yes
checking for MySQL UNIX socket... /tmp/mysql.sock
And it pass!!!
So,
1- make sure that your mysql is RUNNING.
2- make sure that the socket is under /tmp/
3- start from scratch with ./configure
That should do it ;-)
Yves Boisjoly
UNIX Administrator