On Oct 28, 4:01 am, Giles Thomas <[EMAIL PROTECTED]>
wrote:
> Hi all,
>
> We're implementing some new stuff for our website in Django;
> unfortunately our site currently uses PHP quite heavily (for MediaWiki,
> Wordpress, phpBB and the like), and when we tried deploying the first
> cut of the solution, Apache segfaulted - best guess is that this is a
> result of PHP's problems with a statically linked version of the mysql
> library, which are known to interact badly with mod_python and mysql [1]
>
> Unfortunately, although the problem is with PHP, I have to work around
> it in order to get my Django app working, at least until I can budget
> the time to remove PHP from the site entirely :-)
>
> I guess quite a lot of people out there have had similar problems, so I
> was wondering what the most popular workaround is?  Here are the options
> I've found or been told about so far:
>
>     * Use mod_wsgi so that all of the Django stuff is kept in a separate
>       process.  (A bit ugly.)

Separate processes are provided by daemon mode of mod_wsgi, embedded
mode works the same as mod_python. Either way, it will not help in
this case as PHP preloads everything in the Apache parent process and
thus it infects even the mod_wsgi daemon mode processes as they are
forked from Apache parent process just like Apache child worker
processes.

>     * Run a separate server (Apache, lighthttpd, or whatever) just for
>       Django.  (Even uglier.)

But if the option of recompiling code is not realistic, the easiest to
do.

>     * Recompile PHP with the appropriate flags to make it use a shared
>       mysql library.  (Scary!)

But the preferred option.

Do not though that it isn't an issue with a static MySQL client
library being used, but that the shared library it uses is a different
version, or different variant, ie., not thread safe or reentrant.

This specific issue is talked about in mod_wsgi documentation at:

  
http://code.google.com/p/modwsgi/wiki/ApplicationIssues#MySQL_Shared_Library_Conflicts

You should perhaps run 'ldd' as shown in example there and work out
what versions/variants of shared libraries are being used by PHP,
Python and Apache as appropriate. Post the details here as then can
tell you better what you may be able to do about it.

BTW, another option which would work is to use Postgresql for Django
instead. Some would argue this is a better database anyway. ;-)

Graham

> Any thoughts would be much appreciated.
>
> Regards,
>
> Giles
>
> [1]http://docs.djangoproject.com/en/dev/howto/deployment/modpython/#if-y...http://modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp
>
> --
> Giles Thomas
> MD & CTO, Resolver Systems Ltd.
> [EMAIL PROTECTED]
> +44 (0) 20 7253 6372
>
> Try out Resolver One! <http://www.resolversystems.com/get-it/>
>
> 17a Clerkenwell Road, London EC1M 5RD, UK
> VAT No.: GB 893 5643 79
> Registered in England and Wales as company number 5467329.
> Registered address: 843 Finchley Road, London NW11 8NA, UK
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to