[Xapian-discuss] building php bindings

Olly Betts olly at survex.com
Fri Nov 17 19:00:01 GMT 2006


On Fri, Nov 17, 2006 at 11:00:01AM -0700, dennis wrote:
> James Aylett wrote:
> >That's a sensible (in PHP's eyes) extension-dir - try just creating
> >that directory.
>
> and that worked. well I feel silly.

No need to feel silly - something is odd here.

Once you've run "make install", does PHP find the xapian extension
correctly with it installed in
'/usr/local/lib/php/extensions/no-debug-non-zts-20050922'?

I.e., does this PHP4 script work (and report the correct version)?

<?php
dl('xapian.so');
echo xapian_version_string()."\n";
?>

Or for PHP5:

<?php
dl('xapian.so');
echo Xapian::version_string()."\n";
?>

> I have built php/apache/etc a ton of times, but am not familiar with 
> php-config or its output.
> 
> It didn't look like a sensible dir to me, so I was mucho confused. 
> extension_dir in my php.ini is set to /usr/local/lib. I don't know
> why there would be a difference.

Hmm, it seems wrong to mix PHP extensions and shared libraries.  Is
this the default for your platform rather than something you (or your
sysadmin) have set yourself?  What platform is this?

But this raises an issue - "php-config --extension-dir " reports the
build time setting, whereas that could have been overridden in php.ini.
We can get the php.ini value using:

php -r 'print ini_get("extension_dir")."\n";'

Currently we cope with installing without the CLI version of PHP
installed - I guess in this case we could fall back to php-config.

But this reads the CLI PHP setting, which might be different from that
which mod_php sees.  So I don't really know what the best answer is!
Perhaps to just use php_config which works for most people.  And if
you change this in php.ini, you have to do extra work to install.

Thoughts?

Cheers,
    Olly



More information about the Xapian-discuss mailing list