Using C libraries and PHP - calling functions in external libraries
- From: Otis <otie_nospam@xxxxxxx>
- Date: Fri, 15 Feb 2008 18:26:42 -0800
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
.
- Follow-Ups:
- Re: Using C libraries and PHP - calling functions in external libraries
- From: Norman Peelman
- Re: Using C libraries and PHP - calling functions in external libraries
- Prev by Date: Re: Code
- Next by Date: Re: Using C libraries and PHP - calling functions in external libraries
- Previous by thread: preg_replace() eating matched strings
- Next by thread: Re: Using C libraries and PHP - calling functions in external libraries
- Index(es):
Relevant Pages
|