Home  >  Article  >  Backend Development  >  Detailed explanation of php running process and principles

Detailed explanation of php running process and principles

黄舟
黄舟Original
2017-09-25 09:17:385436browse

First introduction to PHP
1. Run php from the script command line
(1)Open cmd.exe(winkey+R)
(2) Find php.exe (just drag it into cmd)
(3) Enter the command php.exe -f "actual path of the file"
Note: Run the code php.exe -r "code"
A concept:
In the running mode of web software, a request is always initiated on the client side (browser side) first, and then the server side generates a feedback action (that is, "runs" the program), and therefore returns information to the browser - ( Response)
2. Web running process
1. Enter the address in the browser and press Enter (send the request)
2 Find the corresponding web server according to the rules
(1) First Find the corresponding IP in the local hosts file
Location: operating system/system32/drivers/etc/
Note: You need to open the editor as an administrator to edit and save it
(2) If in hosts If not found, go to the Internet to find the corresponding IP (in the DNS server)
(3) If it is still not found, terminate the request and return the "server not found" prompt
3. The web server obtains the corresponding file (that is, the requested file) File)
4. If necessary, process the file (execution of PHP code)
5. Return the file (or execution result file) to the browser (return response)
6. The browser accepts the file
7. Browser processing files (display/execution)
PHP web page operation principle


The above is the detailed content of Detailed explanation of php running process and principles. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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