[Yazlist] installing PHP/Yaz at runtime

Brian Bain yaz at tefen.net
Fri Oct 26 22:20:09 CEST 2001

Actually, I believe in theory I can install just an implementation of
PHP with YAZ support as a stand alone CGI.  But I wasn't really
interested in doing that.  

Shouldn't it be possible to build a shared object with the PHP/YAZ
functions defined in it then load that at runtime?  This was the
direction I was looking into going with this project.  However, I've
decided to finish the main body of the project first, which can be moved
into production without the YAZ capabilities, then work on that portion
of the project at a more convenient time.

Adam Dickmeiss wrote:
> On Thu, Oct 18, 2001 at 02:02:57PM -0700, Brian Bain wrote:
> > I'm interested in running the PHP/Yaz extensions on an existing PHP
> > installation (that I don't have administrative rights to) using the dl()
> > function to load it at runtime.  This requires a dynamic shared object
> > library.
> If you don't have access rights to the web server, such as Apache,
> there's no way you can make it load your module. To do so requires
> modifications to httpd.conf.
> > I'm rather new to compiling code on a Linux box.  I have been able to
> > properly install Yaz using the make files, but this creates a static
> > libyaz.a library without the proper ELF headers.
> It's true that YAZ, by default, generates a static library. That,
> however, is linked with PHP's YAZ extension, which in turns makes
> a combined shared library. (YAZ 1.8 may be compiled as a shared
> object, but that's besides the point anyway).
> If you would like to run PHP/YAZ on the main web server on the
> Linux machine you have to get root access (or similar).
> Another way to use PHP/YAZ is to install Apache yourself
> somewhere in your home directory and then listen on, say,
> port 8080. That's a three step operation.
> 1) compile and install Apache
> 2) compile YAZ (install not necessary)
> 3) compile PHP 4.0.6 so that it uses your Apache server and YAZ.
> Allow me to show how I do it - assuming you're not too familiar
> with Linux.
> I unpack Apache, PHP and YAZ in the same directory in /home/adam/proj
> where I keep my projects:
>  cd /home/adam/proj
>  cd apache_1.3.X
>  ./configure --with-prefix=/home/adam/proj/apache --enable-module=so
>  make
>  make install
>  cd ../yaz-1.8
>  ./configure
>  make
>  cd ../php-4.0.6
>  ./configure --with-yaz=../yaz-1.8 --with-apxs=/home/adam/proj/apache/bin/apxs
>  make
>  make install
> Start apache:
>  cd ../apache
>  bin/apachectl start
> Your HTML root is in:
>  /home/adam/proj/apache/htdocs
> Important: You must have Perl installed. Otherwise Apache's apxs doesn't
> work.
> Cheers,
>   Adam
> > Would it be possible for someone to help me get from the point of having
> > untarred the files to having a working ".so" file?
> >
> > I've read this page:
> >
> > http://www-106.ibm.com/developerworks/linux/library/l-shobj/?loc=crtheme
> >
> > which was very helpful, but am not sure how to apply
> > it directly to the Yaz installation as there seems not to be a
> > "libyaz.h" or "libyaz.c" file.  Rather libyaz.a appears to ball a large
> > number of other libraries into one.
> >
> > I get the impression I should be building my own libyaz.c which includes
> > the libraries in the include directory.  Before I attempt this I would
> > like to know if I'm even on the correct path.
> >
> > Any help would be greatly appreciated.
> >
> >   Thanks,
> >     Tefen

More information about the Yazlist mailing list