i wouldn\'t suggest using a series of modules for php. The zend api really restricts using existing C code. Instead, I\'d write a wrapper C program that takes the function you want to call and its args and calls said function sending output to stdout. Then in php, I\'d call the wrapper program with popen() and read the returns off the pointer provided. viz
wrapper.c
#include \"my_fancy_lib.h\"
int main(int arc, char *argv[])
{
// do some seteuid here since apache runs
// under a limited account
// do a switch here on argv[1] which
// is your library call. run the call with
// argv[2] to (argv[argc-2]) or similar.
//exit
}
compile to taste. in php
$my_arg = \"foo\";
$my_arg2 = \"bar\"; // this calls for an array really
popen (\"a.out $my_arg $my_arg2\", $result);
// now open $result pointer and enjoy
that\'s completely off the top of my head... fair warning.