Running an executable as a server-side "script"
I've been currently using PH开发者_StackOverflow社区P on Apache (on Ubuntu) to do dynamic server-side stuff, but is it possible to run a compiled C program as the intermediary? If so, how? I know it's probably not that useful anyway, but I'm curious.
You can use CGI with any language, here's an example for C. CGI is slow and not very flexible though, so you should avoid it. If you really need to write a web application in C, try something more robust like OKWS.
That said, writing a web application in C has very little advantages for most cases. Consider it only if your application is CPU bound.
You could use any of PHP's system, exec or shell_exec to run a script from php
精彩评论