Hi,
Since upgrading to Xapian 1.0 I'm no longer able to get the python
bindings to work running under apache with mod_python.
Works fine from the python command line interpreter/a python script,
but not under apache.
There's no exception and nothing in the server error logs. I figured
it might be a permissions issue but chmod -R 777 on the index
directory didn't help. Tried on two different machines so far. Yes,
the index was generated using 1.0.
Below is a basic mod_python handler that fails for me. It prints
Begin but not OK.
Where do I begin to figure out what's wrong here?
Thanks,
Jason
from mod_python import apache
import xapian
def handler(req):
req.content_type = "text/html"
req.write('Begin')
d = xapian.Database('my/index/path')
req.write(' OK')
return apache.OK
Philip Neustrom
2007-May-25 00:39 UTC
[Xapian-discuss] Xapian 1.0 / Apache / Python problem
What's the sys.path for your apache mod_python configuration? Make sure it's pointing to where the python xapian libraries exist. --Philip On 5/24/07, Jason Stitt <jason@wistechnology.com> wrote:> Hi, > Since upgrading to Xapian 1.0 I'm no longer able to get the python > bindings to work running under apache with mod_python. > > Works fine from the python command line interpreter/a python script, > but not under apache. > > There's no exception and nothing in the server error logs. I figured > it might be a permissions issue but chmod -R 777 on the index > directory didn't help. Tried on two different machines so far. Yes, > the index was generated using 1.0. > > Below is a basic mod_python handler that fails for me. It prints > Begin but not OK. > > Where do I begin to figure out what's wrong here? > > Thanks, > Jason > > > from mod_python import apache > import xapian > > def handler(req): > req.content_type = "text/html" > req.write('Begin') > > d = xapian.Database('my/index/path') > > req.write(' OK') > return apache.OK > > _______________________________________________ > Xapian-discuss mailing list > Xapian-discuss@lists.xapian.org > http://lists.xapian.org/mailman/listinfo/xapian-discuss >
Richard Boulton
2007-May-25 10:03 UTC
[Xapian-discuss] Xapian 1.0 / Apache / Python problem
Jason Stitt wrote:> There's no exception and nothing in the server error logs. I figured it > might be a permissions issue but chmod -R 777 on the index directory > didn't help. Tried on two different machines so far. Yes, the index was > generated using 1.0.I'm guessing that an exception is getting thrown, but not finding its way to the logs. I'm not very familiar with mod_python, so I don't know why this might be happening, but you could try changing your code to something like the following to display what the exception being thrown is: from mod_python import apache import xapian def handler(req): req.content_type = "text/html" req.write('Begin') try: d = xapian.Database('my/index/path') except xapian.Error, e: req.write(' %s: %s" % (e.get_type(), str(e))) except Exception, e: req.write(' %s', str(e)) req.write(' OK') return apache.OK