We all know that when nginx parses a php request, it will transfer the request to fpm for processing. I want to write a simple web server myself, and now it can also parse the php request. That is how to pass the request like nginx. give fpm and receive f I don’t quite understand the return information of pm processing. I took a cursory look at the source code of nginx and couldn’t find any relevant code. So please give me a simple demo example or anyone who knows the code of nginx. It doesn’t matter where it is, I’ll go see it myself
漂亮男人2017-05-16 13:12:24
What you need to understand is the CGI and FastCGI protocols. Just like the HTTP protocol used between the browser and Nginx, the FastCGI protocol is used to communicate between Nginx and PHP-FPM.
巴扎黑2017-05-16 13:12:24
A simple WebServer Demo https://github.com/zhoumengka... The original poster can refer to this idea