a conflict between django and php4

12 views
Skip to first unread message

zhongke chen

unread,
Sep 18, 2006, 10:45:39 PM9/18/06
to django...@googlegroups.com
i'm using django with apache2. if i disable php4 module of
apache2(using a2dismod php4), my django application runs well. if i
enable php4 module and log a user in, my django application gives the
following error message:

Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line
299, in HandlerDispatch
result = object(req)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py",
line 163, in handler
return ModPythonHandler()(req)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/modpython.py",
line 136, in __call__
response = self.get_response(req.uri, request)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/handlers/base.py",
line 59, in get_response
response = middleware_method(request)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/middleware/locale.py",
line 16, in process_request
language = translation.get_language_from_request(request)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/utils/translation/trans_real.py",
line 308, in get_language_from_request
lang_code = request.session.get('django_language', None)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/sessions/middleware.py",
line 35, in get
return self._session.get(key, default)

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/sessions/middleware.py",
line 57, in _get_session
self._session_cache = s.get_decoded()

File "/usr/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/contrib/sessions/models.py",
line 65, in get_decoded
raise SuspiciousOperation, "User tampered with session cookie."

SuspiciousOperation: User tampered with session cookie.

i need to use php4 and django together, how can i solve it?appreciate any help

my system:
debian linux
kernal version 2.6.17-2-686
apache2 2.0.55-4.2
libapache2-mod-python 3.2.10-1
python 2.4.3
django 0.95

--
from czk.

Bryan Murdock

unread,
Sep 19, 2006, 12:24:10 AM9/19/06
to django...@googlegroups.com
On 9/18/06, zhongke chen <czk19...@gmail.com> wrote:
>
> i'm using django with apache2. if i disable php4 module of
> apache2(using a2dismod php4), my django application runs well. if i
> enable php4 module and log a user in, my django application gives the
> following error message:
>
> Mod_python error: "PythonHandler django.core.handlers.modpython"
<snip/>

Are you having this problem?

http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.013.htp

Bryan

zhongke chen

unread,
Sep 19, 2006, 12:52:02 AM9/19/06
to django...@googlegroups.com
Not the same problem.

if i enable php4, and i do not log in under django, my django app
works too. if i log in, error occurs.


--
from czk.

Malcolm Tredinnick

unread,
Sep 19, 2006, 1:03:31 AM9/19/06
to django...@googlegroups.com
On Tue, 2006-09-19 at 12:52 +0800, zhongke chen wrote:
> Not the same problem.
>
> if i enable php4, and i do not log in under django, my django app
> works too. if i log in, error occurs.

Could it possibly be a repeat of this problem:

http://groups.google.com/group/django-users/browse_frm/thread/eeb44c894342d6f7/535749bbc456d296?lnk=gst&q=md5+problem&rnum=7#535749bbc456d296

I'm not sure if there was ever a resolution to that one. There is
another thread on the same list around that time (search for md5) with
some related information, if memory serves.

Regards,
Malcolm


zhongke chen

unread,
Sep 19, 2006, 1:28:31 AM9/19/06
to django...@googlegroups.com
Thanks! i solve this by removing libmhash package. but it's only a
workaround solution. i expect to see a perfect one.


--
from czk.
My old mail boxes(czk...@163.com, c...@wznc.zj.cn) have been
deprecated. Please contact with me using the following email address
from now on: czk19...@gmail.com.
If you want to attach word/excel/powerpoint files for me, please
convert them to pdf. because i have no money to buy ms-office.

Nikolaus Schlemm

unread,
Sep 19, 2006, 1:48:58 AM9/19/06
to django...@googlegroups.com
hi,

Am Dienstag, 19. September 2006 07:28 schrieb zhongke chen:
> Thanks! i solve this by removing libmhash package. but it's only a
> workaround solution. i expect to see a perfect one.

unfortunately, the problem seems to be somewhere within modpython which
somehow doesn't use the md5-module that's used when running python in scripts
or your interpreter... on the modpy-mailinglist I had posted an example that
used the checksums from the md5-rfc. sadly this would only work correctly
after the mentioned workarounds (disabling mod-php or uninstalling libmhash).

if both those two workarounds don't work for you, I have offered a third one
on:

http://code.djangoproject.com/ticket/2249
--
cheers,

Nikl

Reply all
Reply to author
Forward
0 new messages