On Jul 18, 3:28 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Cyril Bazin wrote: > > Thanks for your reply > > > The apache log contains lines like : > > > [Tue Jul 15 23:31:01 2008] [notice]mod_python(pid=11836, > > interpreter='www.toto.fr'):Importing module > > '/usr/local/apache2/htdocs/intranet/courrier/test.py' > > [Tue Jul 15 23:31:02 2008] [notice] child pid 11836 exit signal > > Segmentation fault (11) > > [Tue Jul 15 23:31:19 2008] [notice]mod_python(pid=11764, > > interpreter='www.toto.fr'):Importing module > > '/usr/local/apache2/htdocs/intranet/courrier/test.py' > > [Tue Jul 15 23:31:19 2008] [notice] child pid 11764 exit signal > > Segmentation fault (11) > > > I think the problem comes from the MySQLdb module. > > If I can't find another solution, I think I will downgrade the MySQLdb > > version to 1.2.1 > > Sounds like version hell. mod_python and MySQLdb have to be > compiled with exactly the same compiler for this to work.
Use of compatible compilers applies to anything you want to use together. This is nothing specific to mod_python, so this comment is a bit misleading. These days with with GNU C everywhere, it is hardly and issue, and was usually only an issue with C++ code and not C code anyway. > mod_python is usually troublesome. Python doesn't really have > quite enough isolation to run multiple unrelated instances reliably. The isolation issue is nothing to do with Python itself. Isolation is an issue in this case, but most likely comes about because the OP is trying to use both PHP and mod_python together in the same Apache instance. In particular, the PHP package is likely loading a MySQL module and it is linked against a different version of the MySQL client libraries than what the Python MySQL package is wanting. People like to blame mod_python for these problems, but it can equally be attributed to PHP. In practice the reason it shows up as a mod_python issue is that PHP tries to preload a lot of stuff and so manages to load its version of shared libraries first. Python with its lazy loading comes in second, and so conflicts will occur. If mod_python preloaded stuff like PHP did and this was occurring before PHP got a chance, it would be the other way around and mod_python would work fine and PHP would instead be what crashes all the time. > We use FCGI, which has the isolation of CGI but doesn't reload the > application for every transaction. Also, it's easier to debug if > CPython is crashing. With the reason that FCGI works being that the processes, even if they are spawned by Apache, use a fork/exec, thus meaning they have a clean memory space when starting up. In summary, look at what version of MySQL libraries are used by PHP modules and ensure that Python MySQL module is compiled against the same version. Graham -- http://mail.python.org/mailman/listinfo/python-list