I'm currently writing an http server in C# and I'm planning on allowing it to use PHP. How does PHP work? Like, the compiler or whatever it uses. I was thinking it takes php files in input and outputs the html or whatever file for the http server to give to the user's request. Is开发者_如何学C it possible to call on the php compiler or whatever with the file requested by the user? Please tell me if I'm thinking about this the wrong way.
Thanks
There are a couple ways to interact with PHP. The easiest way to get started is to implement CGI in your program.
Wikipedia has a nice example.
Basically, you execute PHP-CGI.exe, and send/receive data over standard in/out.
精彩评论