search

Home  >  Q&A  >  body text

c - How does the http server support the php language?

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?

漂亮男人漂亮男人2796 days ago595

reply all(5)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 13:01:17

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

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:01:17

    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

    reply
    0
  • 黄舟

    黄舟2017-05-16 13:01:17

    Http ip three-way handshake

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:01:17

    unix domain socket ?

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:01:17

    You can refer to Apache’s source code

    reply
    0
  • Cancelreply