php internal(php體繫結構跟原理)

來源:互聯網
上載者:User
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


著作權聲明:本文為博主原創文章,未經博主允許不得轉載。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.