Xiao-Wei (Shawn) Xu
2012-Apr-01 03:51 UTC
[Xapian-discuss] php fatal error no matching for overloaded function Enquire_set_sort_by_key
I'm using PHP. Xapian is giving me this: Fatal error: No matching function for overloaded 'Enquire_set_sort_by_key' in PATH/xapian.php line 1068 Confirmed that the xapian.so extension is loaded successfully. var_dump(function_exists('Enquire_set_sort_by_key') outputs true. in xapian.php line 1068 : case 1: Enquire_set_sort_by_key($this->_cPtr,$sorter); break; As the source code of the function suggests, it has to be passed a third parameter so I did: case 1: Enquire_set_sort_by_key($this->_cPtr,$sorter, FALSE); break; but after this, I got 'segmentation fault from the apache error log and no response is processed and sent back to browser. Is it a but in xapian.so or what, how to solve this? Thanks.
Olly Betts
2012-Apr-03 05:11 UTC
[Xapian-discuss] php fatal error no matching for overloaded function Enquire_set_sort_by_key
On Sun, Apr 01, 2012 at 11:51:10AM +0800, Xiao-Wei (Shawn) Xu wrote:> I'm using PHP. Xapian is giving me this: > > Fatal error: No matching function for overloaded 'Enquire_set_sort_by_key' > in PATH/xapian.php line 1068What version of Xapian are you using? Line 1068 doesn't seem to match with 1.2.9, so I'm guessing something older. This seems to work for me with 1.2.9, and is even tested in smoketest.php. It looks like that test was added in 1.0.5 in 2007. Omitting the second parameter is deprecated and in 1.3.0 you have to specify it, but the generated code doesn't have a case statement in 1.3.0, so I don't think you're using that. So more information required I'm afraid. As well as the version you are using, a minimal PHP script which shows the problem would be useful. Cheers, Olly