calling a native library

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am developing a PHP site to run on a Linux server. I need to access a  
proprietary algorithm that is compiled into a C shared object.

I have been looking for the best way to do this and noticed that I can  
write a Zend engine extension to allow me to do this but I was wondering  
if there was a more simple way.

Is a PHP library that allows me to load and the .so file without having  
to write my own wrapper (sort of like a dlopen() or LoadLibrary() for  
PHP)? I have looked at the PHP manual on but couldn't see anything.

Are there any other alternatives or is the Zend extension the best/only way.

I am more familiar with C & C++ than PHP so forgive me if this is a  
stupid question.

Thanks very much in advance

Re: calling a native library

user@domain.invalid wrote:

Quoted text here. Click to load it

I'm not aware of anything like you suggest. Wite your own main(argc, argv)
function to call it then use one of the program execution fns in PHP? I
guess by the time you created a daemon wrapper around the library and wrote
the PHP end, you'd probably be as quick building it into a PHP extension.


Site Timeline