Re: Third Party lib.so
| From: | Richard Quadling | Date: | Thu, 05 May 2011 14:56:27 +0000 |
| Subject: | Re: Third Party lib.so | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-8219@lists.php.net to get a copy of this message | ||
On 5 May 2011 15:31, Garry Taylor <giz@gbdesign.net> wrote:
> Hi all, first off thank you for any help you can give... I am very new to
> PHP Extensions however I have been writing C and PHP code for many years.
>
> I am developing an extension that uses a third party pcplib.so file. I have
> written c code that accesses this lib and compiled and tested using gcc.
> Everything works great. I have then ported this code over to an extension
> and compiled/installed.
> The module is shown running under phpInfo() and apache logs show everything
> is running ok (I did get a "compiled with build ID=API20090626,NTS,debug,"
> until I realised I have not compiled PHP with --enable-debug).
> Everything went perfect apart from when I run the php file to access the new
> function I get the dreaded "undefined symbol: GetPostcode"
>
> I am making the assumption that the error relates to the extension not
> including the third party lib as GetPostcode is a method of this lib. My
> question is how do I include the third party lib to compile into the
> extension? I have search the PECL source, edited the M4 config and I have
> even phoned Zend but got shot down and told to look here :(
>
> kind regards
>
> Garry Taylor
>
> --
> PECL development discussion Mailing List (http://pecl.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
The PHP Extension acts as a gateway from userland PHP code and the library.
If you want to expose a library function, you need to create a
PHP_FUNCTION that takes the userland params, passes them to the
library function and then returns the value back to the user.
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY