Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP and C mix programming

Status
Not open for further replies.

lgang

Programmer
Oct 1, 2002
7
US
How can I call a C function in a PHP script? I heard on windows there is an interface so that you can call win32 functions, is there a correpsonding way on Unices (solaris, linux for example)?

BTW, what is the most popular php debugging tools?

Thanks a billion
 
heres teh quickref to PHP functions, some of these (alot actually) originate from C.

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
There is no method to directly call C functions inside PHP, unless you compile those functions as an extension to PHP (
But, if your C application can be called from the command line, with arguments, such as "myprogram arg1 arg2", or any combination of command-line calls (including piping), then PHP will talk to it just fine ( As you can see from the last link, there are several methods for program execution, depending on just how you want the execute, capture output, errors, etc...

If you have any experience with Perl, PHP's program execution functions are very similar. -------------------------------------------

Big Brother: "War is Peace" -- Big Business: "Trust is Suspicion"
(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top