Re: Using C libraries and PHP - calling functions in external libraries
>> You might try a host that allows dynamic loading of your dll via the
dl() function.
Unfortunately, my .dll is a Windows .dll (I think it is compiled with C),
not a PHP extension - and it needs to run on my hosted UNIX server, so I
don't think you can just put a Windows .dll on a UNIX server and expect a
PHP call to it to respond properly.
Can you???
Otis
Norman Peelman wrote:
Otis wrote:
Currently I am running a compiled C program (called swetest) on Linux
from PHP using the exec() command. This allows me to get the
calculations I need. But some web hosts out there disable the exec()
command and I am stuck. What are the ways in which I might be able to
call the functions in swetest directly from PHP without having to rely
on the PHP exec() command and its buddies like system, shell_exec(),
etc., which are also disabled.
I have the following C files available:
swetest.c
libswe.a (which I guess is the created library)
On a Windows system, I can make a .dll (astro_php.dll), then call it
from PHP thusly:
$obj = new COM("astro_php.astro_php_cls");
$output=$obj->Get_geo_planet("2454507.5", "2");
echo $output;
How does one do something similar on Linux instead of Windows?
Thank you.
Otis
You might try a host that allows dynamic loading of your dll via the
dl() function.
.
Relevant Pages
- Re: [PHP] Missing DLLs
... Is that something in PHP source that could be fixed to specify WHICH dll is really missing? ... I'm happy to put it in bugs.php.net as a feature request, if it's actually IN php, but don't want to waste the resources to mark it as junk if there's no way PHP could do that. ... It's been a while since I've done Windows development, but IIRC PHP will only be able to tell that the DLL could not be loaded, I don't believe Windows exposes exactly what the problem was. ... Because I can recall other times that you got the urge to hit your head on the keyboard multiple times in order to get over the fact that the problem that caused the error was so ...king obvious. ... (php.general) - Re: [PHP] Missing DLLs
... Is that something in PHP source that could be fixed to specify WHICH dll is really missing? ... I'm happy to put it in bugs.php.net as a feature request, if it's actually IN php, but don't want to waste the resources to mark it as junk if there's no way PHP could do that. ... It's been a while since I've done Windows development, but IIRC PHP will only be able to tell that the DLL could not be loaded, I don't believe Windows exposes exactly what the problem was. ... Because I can recall other times that you got the urge to hit your head on the keyboard multiple times in order to get over the fact that the problem that caused the error was so ...king obvious. ... (php.general) - PHPCoder & DBG
... dll into the same extensions folder. ... There are some versions of php_dbg.dll-x.x.x where x.x.x is a php ... note that clienthost is a keyword for DBG. ... instructions, especially Installation of Windows extensions, then ... (comp.lang.php) - Some extensions loading, some not
... Windows Server 2003 Standard SP1 ... I am decently familiar with installing and configuring PHP and have ... and that the permissions on the DLL files are correct. ... (comp.lang.php) - Re: Using C libraries and PHP - calling functions in external libraries
... Unfortunately, my .dll is a Windows .dll, ... PHP call to it to respond properly. ... How does one do something similar on Linux instead of Windows? ... (alt.php) |
|