The principle of the PHP cache Accelerator for lamp and LNMP environments

Source: Internet
Author: User
Tags fpm php source code

LAMP Environment PHP how the Cache accelerator works  

lamp=linux+apache+mysql+php

1. Apache receives the client's PHP program request and filters it according to the rules.

2.Apache sends PHP program request to PHP processing module libphp5.so.

The 3.PHP engine locates the PHP file on the disk and loads it into memory for parsing.

The 4.PHP processing module libphp5.so the PHP source code into an opcode.

The 5.PHP processing module libphp5.so executes the opcode and caches the opcode.

6. Apache receives a new PHP program request from the client, and the PHP engine directly reads the cache execution opcode file.

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/8B/4D/wKiom1hJDqKjfwkeAABtSb__iK0658.jpg-wh_500x0-wm_3 -wmp_4-s_2022119964.jpg "title=" LAMP. JPG "alt=" Wkiom1hjdqkjfwkeaabtsb__ik0658.jpg-wh_50 "/>

Lamp Classic website architecture php opcode caching principle

Lnmp Environment PHP how the Cache accelerator works

lamp=linux+nginx+mysql+php

1. Nginx receives the client's PHP program Access request.

2. Nginx passes the PHP program request to the FCGI (PHP-FPM) process that parses PHP based on filtering rules such as extension.

3. the PHP fpm process calls the PHP parser to read the PHP file on the site disk and load it into memory.

The 4.PHP parser compiles the PHP program into an opcode file and caches the opcode.

After the 5.PHP fpm engine executes the opcode, it returns the data to Ngnix and returns the client.

6.Nginx receives a client's new PHP program request, the PHP fpm engine reads the opcode in the cache and executes it, returning the result.

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/8B/49/wKioL1hJEA2xOhAVAABn6XiAmV4085.jpg-wh_500x0-wm_3 -wmp_4-s_3143522770.jpg "title=" LNMP. JPG "alt=" Wkiol1hjea2xohavaabn6xiamv4085.jpg-wh_50 "/>

LNMP Classic website architecture php opcode caching principle

This article is from the "sky9890" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1880767

The principle of the PHP cache Accelerator for lamp and LNMP environments

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.