Before starting this topic, let's talk a little bit about it. When learning a programming language, most people focus on the syntax and common functions of the language. Anyway, I started learning C, Java, PHP and other languages in this way. Generally, this phase takes about a month to fully master and be able to use it skillfully. It may take less time for experienced students. In fact, the syntaxes and common functions in different languages are not much different, and there are many similarities. If you take some real project tasks as practice when learning a programming language, the effect is better, and the practice is far better than the theory.
After mastering a programming language, we will develop in two directions: one is to extend upwards and to explore the system framework; the other is to extend downward, I am engaged in research on the underlying aspects of the system. I have drawn a curve of this learning process.
Note: Although my image has always been a "master", I am only a cainiao. If there are similarities, it is a coincidence. You are welcome to make a brick in good faith.
PHP syntax is very simple. It can be used without a lot of knowledge. For example, if you study C language, you must have a good understanding of how to define various variables and how to operate pointers, memory creation and destruction. For example, if you want to learn the Java language, you must have the foundation of object-oriented (OO). Then you must know when encapsulation is required, when inheritance is required, and when polymorphism is required, to do a project, you must understand ssh. Most PHP users may not be so specific at all. Some users prefer process-oriented, so you can write code in process-oriented mode. Some users prefer object-oriented, then you can write code in an object-oriented way. The emergence of PHP is due to the Internet, which is currently the largest programming language on the Internet. Meeting requirements is always the first, and maintainability can be placed at 2nd bits. Our Web applications will always be beta, and the plan is far from changing rapidly.
There are many phper in our company. I once asked them: "How are PHP programs executed ?", It seems that most people are hard to tell clearly. This is not surprising. I once asked javaer a similar question, and the answer from javaer is basically the same. Some students asked: "Is there any practical significance to study such a problem ?" Yes! Understanding the underlying layer of the system helps to write highly efficient and robust code. You will be more clear about how to write the program code. In addition, it is not necessary to write PHP extensions.
To clarify this problem, the best way is to read the PHP source code. I have nothing to do with it. I have read it again and would like to share it with you.
The underlying Working Principle of PHP cannot be used to bypass Webserver, such as Apache, Lighttpd, nginx, and IIS. I will start with Apache here. The following content will be combined with the Apache source code, working principles and extensions to gradually cut into the PHP parsing process.