Home > Backend Development > PHP Problem > How does php work?

How does php work?

王林
Release: 2023-02-26 08:42:02
Original
10994 people have browsed it

How does php work?

1. All PHP applications are executed through WEB server (such as IIS, Nginx or Apache) and PHP engine program interpretation

Working process:

1. When the user enters the file name of the PHP page to be accessed in the browser address, a web request is triggered and the request is sent to the WEB server.

2. The WEB server accepts this request and determines it is a PHP request based on its suffix. The WEB server calls out the PHP application the user wants to access from the hard disk or memory and sends it to the PHP engine program. .

3. The PHP engine program will scan the file sent from the WEB server from beginning to end, read it from the background according to the command, process the data, and dynamically generate the corresponding HTML page.

4. The PHP engine will generate an HTML page and return it to the WEB server. The WEB server then returns the HTML page to the client browser.

2. PHP operating mode

1. cgi Common Gateway Interface (Common Gateway Interface))

2. fast-cgi resident (long -live) type CGI

3. cli command line operation (Command Line Interface)

4. Web module mode (module mode for running web servers such as apache)

Recommended tutorial: PHP video tutorial

The above is the detailed content of How does php work?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template