Hi All,
I worked with xapian 0.9.10 and now decided to use xapian 1.0.4 with
php5.2.2 on RHEL4 x86_64.
Xapian core and php-binding were successfully installed.
But simple test for adding docs to database caused segmentation fault.
code:
<?php
set_time_limit(0);
$_xapianDB = Xapian::flint_open("database", Xapian::DB_CREATE_OR_OPEN);
$xapianDoc = new Xapian_Document();
$xapianDoc->add_value(1, 1000);
$xapianDoc->add_posting('1000', 1, 100000);
try{
$_xapianDB->add_document($xapianDoc);
} catch (Exception $e) {
echo "saving document exception: ". $e->getMessage(). "\n";
}
$_xapianDB->flush();
?>
Is there anybody who met this problem too? How did you solve it?

Looking forward to read your feedback,
Vaso.

Search Discussions

  • Daniel Ménard at Nov 13, 2007 at 2:15 pm

    Vasiliy Sergeev a ?crit :
    $xapianDoc = new Xapian_Document();
    Xapian_Document (with an underscore) is not a valid xapian class (but
    XapianDocument is) and your code should generate a fatal error 'class
    not found'.
    Do you have anything in your code/configuration which would hide such
    errors?
    It would perhaps explain why you get a segfault (new Xapian_Document()
    return null and null->add_value() hangs).

    Just a guess...

    --

    Daniel M?nard
  • Vasiliy Sergeev at Nov 14, 2007 at 8:11 am

    Daniel M?nard wrote:
    Vasiliy Sergeev a ?crit :
    $xapianDoc = new Xapian_Document();
    Xapian_Document (with an underscore) is not a valid xapian class (but
    XapianDocument is) and your code should generate a fatal error 'class
    not found'.
    Do you have anything in your code/configuration which would hide such
    errors?
    It would perhaps explain why you get a segfault (new Xapian_Document()
    return null and null->add_value() hangs).

    Just a guess...
    Hi Daniel,
    Sorry for confusion.
    I am using my own php-classes based on original php-wrapper. So class
    Xapian_Document is the same as XapianDocument, just name is a bit
    different. That was done for autoloading php5 ability. This is not the
    case since this code works fine on xapian 0.9.10, php 5.2.2 (CLI).
    I have made valgrind with executing my php-script. If it helps I could
    post valgrind's log, but it is 9Kb. Is there any way to atach files to
    discussion?

    -------------- next part --------------
    A non-text attachment was scrubbed...
    Name: test.log
    Type: text/x-log
    Size: 9257 bytes
    Desc: not available
    Url : http://lists.tartarus.org/pipermail/xapian-discuss/attachments/20071114/4ef1f1b7/test-0001.bin

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupxapian-discuss @
categoriesxapian
postedNov 13, '07 at 1:33p
activeNov 14, '07 at 8:11a
posts3
users2
websitexapian.org
irc#xapian

2 users in discussion

Vasiliy Sergeev: 2 posts Daniel Ménard: 1 post

People

Translate

site design / logo © 2021 Grokbase