Wrapping existing C code
| From: | Andre Naess | Date: | Wed, 07 Jul 2004 12:46:02 +0000 |
| Subject: | Wrapping existing C code | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-942@lists.php.net to get a copy of this message | ||
Hi
I've been going through the available tutorials on how to develop a PHP
extension, but there is still one thing I don't quite understand.
I have this shared library containing some C code I need to wrap so that it
can be accessed from php. I've gone through the tutorials and built an
extension which calls one of the functions in the library. For simplicity I
added the absolute path to the header files at the start of my extension,
just to test if it would work. I've compiled and installed it, and when I
call the function I get a relocation error from Apache because it can't find
the library function I'm calling.
Say the library is in /home/edmi/libEdmi.so, how do I make this available to
Apache? Is it something I need to configure in apache, or is it something I
have to do in config.m4 for my extension? I tried setting LD_LIBRARY_PATH in
the same shell as I called apachectl restart from, with no luck.
In the tutorials I've seen so far this problem doesn't seem to be covered,
the libraries that are wrapped just magically seem to be available.
Thanks for your time.
André Næss