I have a PHP website with some simple functions. I want to add more functions that use intensive mathematical routines. I want to use a C++ dll to do this. Or I can also compile for *Nix if the necessary for portability. How would I load the .dll (Windows) or .so (*Nix) and then use the functions from it. Any help would be appreciated. Thanks in advance.
@Stephen_PhilbinDec 15.2014 — #Is it a well known library, or something you've written yourself? If it's a well known library, then there may already be an option to just compile it in. On Linux you'd compile it in something like (if my memory serves me correctly) configure-script-dir#./configure --with-some-library=/path/to/library.so configure-script-dir# make configure-script-dir# make install I don't know what the Windows equivalent would be, but it shouldn't be [i]too[/i] diferent.
If it's a custom made library then I don't really know. PHP is (to my knowlege) really just a framework that binds together various libraries. If the information you need is anywhere, I'd image it'd be here http://php.net/manual/en/internals2.structure.php
@Stephen_PhilbinDec 15.2014 — #Yeah, that's probably a much more sensible option. I'd imagine it'd be a heck of a lot less work than trying to build a PHP extension.
Just remember to thoroughly sanitise any user input that gets anywhere near exec.