c - How does the http server support the php language?
漂亮男人
漂亮男人 2017-05-16 12:59:17
0
5
594

Write the server in C language, judge after receiving the request, statically read the file directly and return, dynamically request to fork a child process exec to execute the cgi program, and then the parent process reads the child process result and returns it to the client. How does the cgi program here (that is, the php code) communicate with php?
Is this any different from using FASTCGI to call php-fpm through socket?

漂亮男人
漂亮男人

reply all(5)
Ty80

You may have some misunderstandings, please refer to this article.
http://www.php-internals.com/...

習慣沉默

The http server needs to implement apache's module loading. PHP runs as an apache module. http receives the request and hands the dynamic request to apache's php mod for execution

黄舟

Http ip three-way handshake

漂亮男人

unix domain socket ?

phpcn_u1582

You can refer to Apache’s source code

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template