This was a head scratcher.
I had the misfortune of working on a Solaris 10 server today that exhibited the most bizarre problem. Despite having Mysql 5.0.45 installed in /usr/local/mysql and explicitly setting --with-mysql=/usr/local/mysql PHP configure option, phpinfo() consistently reported that the Mysql Client API version was 4.0.24.
I couldn't for the life of me find any mention of libmysqlclient.so.12
on the machine. Because my access was restricted, I couldn't easily do a find / -name "libmysqlclient.so.12".
As unlikely as it sounds, the 4.0.24 Client API version was getting pulled in as a result of the --with-openssl PHP configure option. It worked as follows:
- In their infinite wisdom, Sun Microsystems decided to ship old versions of open source software and install them in a completely non standard location "/usr/sfw".
- The openssl libraries are installed in /usr/sfw along with Mysql 4.0.24.
- The PHP Configure script knows about the /usr/sfw directory on Solaris and will look for libraries there.
- Once Configure finds the openssl libraries in /usr/sfw it includes /usr/sfw/include and /usr/sfw/lib into the Makefile INCLUDE and LD search paths /BEFORE/ /usr/local/mysql/lib and /usr/local/mysql/include.
- As a result, during the make, the linker finds libmysqlclient.so.12 in /usr/sfw/lib instead of /usr/local/msyql/lib.
The solution is to either uninstall the Solaris 4 package or to upgrade it using instructions found here:http://www.sun.com/bigadmin/features/articles/samp_setup.jsp
If you can't do either you hack the Makefile and edit the paths by hand.
Have I mentioned recently how much I hate Solaris? Actually I hate it more than I do Windows, and that's saying something.