In the past i did create a shared library that now I would like to use it inside a php extension. Is it possible to do that? As I've seen in the config.m4
file PHP_NEW_EXTENSION()
asks for the .cc . The problem is that i don't want to expose my code. I just want to use the header and the shared library i've creaded in c under ubuntu.For the php extention i did create a : config.m4, php_c.h and php_c.cc.
Please help!. THX APPRECIATE I did put in the config file this:
libs=mylib.so;
PHP_ADD_LIBRARY_WITH_PATH(libs, $EXTERNAL_LIB_DIR, ?? what to add here);
I obtain the following:
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '/home/foder/mylib.so'in Unknown on line 0
php: symbol lookup error:
/usr/php5/20090626+lfs/vehicles.so: undefined symbol: _ZN3CarC1Ei (where vehicles.so) is a php so created with: phpize, ./configure --enable-vehicle make..
PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) '/home/foder/mylib.so'in Unknown on line 0
This message means there's no "get_module" function in the ".so".
Make sure the PHP extension source contains the lines:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
and
#ifdef COMPILE_DL_MYLIB
ZEND_GET_MODULE(mylib)
#endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With