开发者

C# Http Server with PHP

开发者 https://www.devze.com 2023-03-28 06:35 出处:网络
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 outpu

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消