Heim  >  Artikel  >  Backend-Entwicklung  >  php internal(php体系结构跟原理)

php internal(php体系结构跟原理)

WBOY
WBOYOriginal
2016-06-13 12:23:451134Durchsuche

php internal(php体系结构和原理)

一.前言-后端如何处理一条index.php动态请求。

很多公司用lnmp环境作为基础软件环境,用php能做快速开发。下面简单描述下,后端是如何处理一个从浏览器发起的 http://www.abcdxxx.com/index.php的请求的。

browser->nginx 通过http协议,nginx 接收浏览器发的动态请求。

browser->nginx->phpcgi,nginx把接收到的请求,通过cgi协议,发送给php-fpm进程做处理。

php-fpm内部处理过程,先把php程序,编译成opcode 字节码,然后把opcode字节码 放到zend 引擎(虚拟机) 上运行,和java类似。

zend 引擎(虚拟机)直接与操作系统,发起系统调用等处理请求。

如果涉及到需要连mysql,那就发起请求,通过mysql client协议,将请求发给mysql,去操作mysql的数据。


二.参考资料

https://github.com/reeze/tipi/blob/master/web/releases/TIPI_2014-04-29_V0.8.3.chm?raw=true

http://yanbin.org/download/php-internals.pdf

http://derickrethans.nl/talks/internals.pdf

http://nginx.org/en/docs/http/request_processing.html

http://cdn.nginx.com/wp-content/uploads/2015/04/150427_NGINX-subway_RGB.png


版权声明:本文为博主原创文章,未经博主允许不得转载。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:PHP学习小结(一)Nächster Artikel:thinkPHP底层设立跳转404页面