开发者

php file: use dlopen and dlsym. how

I have myCode.so file created my linking a .c and .h file. I would like to call this .c file using the myCode开发者_StackOverflow社区.so and dlopen and dlsym . How to do that from php? I need some help! thx.

2. Is there a way to import inside php (config.m4, php_example.h and php_example.c and example.php) a test.cpp code that uses the myCode.so for tests?

NEED SOME HELP! APPRECIATE

I am working in ubuntu (g++ comilper)


If you compiled a PHP extension with the PHP build system (phpize && ./configure && make), you only need to tell PHP to load the extension, and it will take care of dlopen etc:

extension=myCode.so

(myCode.so as to be in extension_dir)

For functions to be callable from PHP code, you have to use the PHP_FUNCTION macro (see other extensions for examples).

For the tests, look in the tests directory in other extensions.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜