[Xapian-discuss] php bindings

Olly Betts olly at survex.com
Thu Mar 16 07:36:31 GMT 2006

On Wed, Mar 15, 2006 at 11:00:38AM +0000, John Wards wrote:
> Have you put:
> extension=xapain.so 

xapian, not xapain!

> In your php.ini file? (next to the mysql ones etc at the bottom on the
> php.ini usually)

This is an alternative to using dl().  If you list an extension in
php.ini, then it will always get loaded.  If you use dl(), it's only
loaded by scripts which want it.

As an example, see "smoketest.php" which uses dl() and is run under
a custom php.ini which doesn't load any extensions.

> On Wed, 2006-03-15 at 14:40 +0530, durga bidaye wrote:
> > I have installed php bindings and 'xapian.so' is present in
> > folder /usr/lib/php4/20050606/( the one wich apache looks fr in order
> > to load dynamic libraries) but inspite of that, when i try to execute
> > the pgm "simplesearch.php" i get the following errors: 
> > 
> > PHP Warning:  Unknown(): Unable to load dynamic library
> > '/usr/lib/php/20050606/xapian.so' - /usr/lib/php/20050606/xapian.so:
> > cannot open shared object file: No such file or directory in Unknown
> > on line 0

I notice that the error says "/usr/lib/php/" whereas you say that
xapian.so is installed in "/usr/lib/php4/".  Was that a typo?  If not
that's probably why it can't be found!

What does this report:

php-config --extension-dir

> > Fatal error: Call to undefined function:  new_database()
> > in /home/jana/final_search1/simplesearch.php on line 30
> > 
> > In php.ini i have set the correct path fr dynamic libraries.bt still i
> > m gettin the error.

If you've set a different path in php.ini, you'll need to move xapian.so
since it will be installed where php-config says, which is hardcoded
into the php-config script (at least it is for PHP 4.1.2).

> > also  am i gettin the error "undefined function
> > new_database" just  becoz the dynamic library is not gettin
> > loaded...



More information about the Xapian-discuss mailing list