- "select *" or "select a, b" fails but "select a" works - apache coredumps - get bogus error messages about float conversions when no float fields are usedusually in the MySQL cursor.execute() routine.
The solution (from David Geller) is as follows:
In my httpd.conf I was loading two DSO modules: mod_python and php4. It turns out, when I removed the reference to php4, the mod_python worked perfectly. Now, why was this? Well, I went back to the php4 module, and checked out "configure" - if you know anything about php, it was being configured with the "--with-mysql" flag, which tells it to use an "internal" version of mysql libs. Apparently, this is fine - as long as *no other modules use mysql* (the php configure tells you this at the end). If they do, you should specify the actual mysql library directory. Well, mod_python was basically another module using mysql. Duuuuh! (well, not so obvious to me, really). When I specified the actual mysql library to php configure, and recompiled and reinstalled the PHP, I could have LoadModules for both php and mod_python and both appear to work.
Thanks David!
----
This problem can happen with other shared libraries too.. For example mod_php can have extensions linked to libpng.so.2 but python may have modules using libpng.so.3 ... This will result in strange problems, hard to reproduce and detect.
The solution would be to limit the number of different libraries on your system and recompile everything from source.
----
Similarly, another library which can cause problems is libexpat. This is because PyXML module for Python actually embeds a version of libexpat into it. Ie., doesn't use a dynamically linked library. If this version is different to that used by PHP, it can cause Apache process to crash because of segmentation violations.
-----
My webhosting company just suggested to run PHP using fastCGI and mod_python to resolve the conflict. This might be a workable alternative as well.
Edit this entry / Log info / Last changed on Sun May 14 15:51:49 2006 by sjoerd schalekamp