I created a static PHP extension which worked fine. I now want to use this extension on another machine, however I would like to use it dynamically. I've tried several ways of doing this but none seem to be working. I need to be able to load the module using the dl() function but everytime I do I get an error. I compiled the code using these command lines:
gcc -fpic -DCOMPILE_DL=1 -l/usr/local/include -I. -I.. -I../Zend -I../main -I../TSRM -I../reges -c -o first_module.o first_module.c
(error)gcc: -l/usr/local/include: linker input file unused since linking not done
gcc -shared -L/usr/local/lib -rdynamic -o first_module.so first_module.o
when I try to load it using dl("first_module.so") I get this error:
Warning: Invalid library (maybe not a PHP library) 'first_module.so' in /dir/script.php on line 4
Could anybody help me?
Another question I have is that for the real extension the I'm creating I need to link a '.a' file, how do I add that to the gcc commands???