Re: How to link .so lib into a PHP Extension
| From: | Sara Golemon | Date: | Sun, 17 Jul 2005 03:17:12 +0000 |
| Subject: | Re: How to link .so lib into a PHP Extension | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2622@lists.php.net to get a copy of this message | ||
Without seeing what your config.m4 currently looks like I can only offer
general hints...
The "simple" answer is:
PHP_ADD_LIBRARY(hsbc,,HSBCEXT_SHARED_LIBADD)
PHP_SUBST(HSBCEXT_SHARED_LIBADD)
Which assumes that the library name is libhsbc and the extension name is
hsbcext (replace as needed).
In general you'll probably want checks for the libraries you're linking
against, take a look at other modules which link external libraries: mysql
(or nearly any DB extension), zlib, gd, bc, ssh2, oggvorbis, etc...
-Sara
""Michael Pawlowsky"" <mikep@mi-consultants.com> wrote in message
news:34689.192.168.5.50.1121564020.squirrel@www...
> Hello,
>
> I am creating an extension to handle HASH encrytions for the HSBC
> Cardholder Payment Interface. Right now the recommended way of doing it is
> to drop to an exec to get the hash. I simply found this not very elegant
> and decided to try and create an extension.
>
> I found a 2 part (3rd part to come it seems) tutorial on Zend that has
> helped quite a bit.
>
> But I am coming up with a small linking issue I believe. Basically
> everything compiles, but when I move the extension .so file into my php
> extension dir and restart apache, I get the error message that it was
> unable to load the module due to unrecognized symbols.
>
> So basically it does not know to look for them in
> /usr/lib/libCcCpiTools.so.
>
> Would this be something I need to add to config.m4? If so, can someone
> tell me what I need to add?
>
>
> Thanks,
> Mike