1. How the web works
I am learning PHP website construction, so the website is on the client and service The operation of the terminal is the foundation of the operation of the website. What is the operation process like?
Web: Terminal
Server web: We call the computer that provides (response) services a server (Server), also called a server side.
Client web: The computer that accepts (requests) services is called the client (Client), also called the client.
Related recommendations: "PHP Tutorial"
2. The specific process of PHP program work
I am learning PHP, so the operating principle of PHP is the collaboration process between Apache, PHP, and browsers:
① When the user enters the file name of the PHP page to be accessed in the browser address , and then pressing Enter will trigger the PHP request and transmit the request to the WEB server (apache) that supports PHP.
②WEB server (apache) accepts this request and judges it based on its suffix. If it is a PHP request, WEB server (apache) takes out the PHP application that the user wants to access from the hard disk or memory, and Send it to the PHP engine program.
③The PHP engine program will scan the file sent from the WEB server (apache) from beginning to end, read it from the background according to the command, process the data, and dynamically generate the corresponding HTML page.
④The PHP engine will generate an HTML page and return it to the WEB server (apache). The WEB server (apache) then returns the HTML page to the client browser, and the last complete page is displayed in front of us through the browser.
1. Apache
In the above process, apache plays a decisive role, so what is apache?
Apache is a network server. This server listens to a TCP port, usually 80, interprets the commands received on the port, and then submits some results. The main commands explained by apache are GET and POST, which generally correspond to the client entering an address in the browser, clicking a link in the browser, and submitting a form. When apache interprets GET and POST commands, if the object of GET and POST is a general file such as HTML, CSS, JS, RAR, TXT, etc., it will directly send the content of the file back to the client; if the object is a PHP file, APACHE starts the PHP.EXE program (the name is different on UNIX, and the details of installing it as a module are different, here are just examples), passes the file and calling parameters to PHP.EXE, and then feeds back the results of PHP.EXE execution. to the client.
Apache HTTP Server (Apache for short) is an open source web server of the Apache Software Foundation. It can run on most computer operating systems and is widely used due to its multi-platform and security. It is one of the most popular web server-side software. It is fast, reliable and extensible through a simple API to compile interpreters such as Perl/Python into the server.
Apache HTTP server is a modular server, derived from NCSAhttpd server. After many modifications, it has become the world's number one web server software.
Apache originated from the NCSAhttpd server. After many modifications, it has become one of the most popular web server software in the world. Apache is taken from the pronunciation of "a patchy server", which means a server full of patches. Because it is free software, people are constantly developing new functions and features for it, and modifying the original defects. Apache is characterized by simplicity, fast speed, stable performance, and can be used as a proxy server.
2. What are the mainstream servers that support PHP?
So besides apache, what other servers support php?
PHP has very good compatibility. Almost all web servers support PHP. The mainstream servers that can run PHP are apache nginx iis.
3. Hypertext
php: (Hypertext Preprocessor) is also called hypertext preprocessor.
So what is hypertext?
Hypertext is a network text that uses hyperlinks to organize text information in various spaces. Hypertext is a user interface paradigm used to display text and content related to the text. Currently, hypertext generally exists in the form of electronic documents, in which text contains links that can be linked to other locations or documents, allowing direct switching from the current reading position to the location pointed by the hypertext link.
Then the hypertext markup language we most commonly use now is HTML.
The above is the detailed content of What is the principle of php website. For more information, please follow other related articles on the PHP Chinese website!