what i did was create a PHP extension (an easy one, about 10 lins of code) with the C function 'dl' (it does about the same as the PHP 'dl).
Then, I put the C functions in a shared library (eg: libMyProject) and then I could call C functions from PHP.
For doing the reverse, I compiled the whole PHP core as a shared lib (8 MB of shared lib) and then compiled my C programs against that library.
I must have the code somewhere over here, but I have and exam his evening, and I won't be able to look for it until I finish.If you are interested, reply to this post, and I'll search for it |