开发者

PHP Warning: PHP Startup: Invalid library (maybe not a PHP library)

开发者 https://www.devze.com 2023-04-01 08:19 出处:网络
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 filePHP_NEW_EXTENSION() asks for the .cc . T

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 开发者_如何学Goobtain 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
0

精彩评论

暂无评论...
验证码 换一张
取 消