I’ve seen this happen a few times, and it’s incredibly simple as to why: Somebody screwed up.
No. Really.
What’s happening about 90% of the time, is that there is a colission between installations. PHP usually uses a dynamic mysql library. Apache auth modules such as 2.2’s internal auth_dbd, and mod_auth_mysql also usually link against a dynamic mysql library.
If you happen to change your development mid-stream and don’t recompile everything, here’s where problems can occur.
To put it as non-geeky as possible: If the MySQL client is v5, and PHP uses this v5, but mod_auth_mysql is using v4, they both are asked to load, end up with with the same functions, and BAM.
It’s kind of like shouting “Hey, Steve!”, and having two guys answer “Yes?” The only difference is, UNIX doesn’t know how to act embarrassed and politely wave over the one that was intended.
Although, this analogy isn’t entirely true. It just makes it easier to understand. PHP wanted Steve v5, and mod_auth_mysql wanted Steve v4. So, when they both tried to call for Steve, both of them ended up in the same place.. which made bad things happen.
You can use ‘ldd’ to see which dynamic libraries are used by which programs, and other libraries.
# ldd /usr/lib/php4/20050606+lfs/mysql.so | grep mysql libmysqlclient.so.15 => /usr/lib/libmysqlclient.so.15 (0xb7d6e000) # ldd /usr/lib/libaprutil-1.so | grep mysql libmysqlclient.so.15 => /usr/lib/libmysqlclient.so.15 (0xb7c56000)