First understanding of PHP running process and principles (1), first understanding of php
First understanding of PHP
1. run php using the script command line
(1)open cmd.exe (winkey + R)
(2.exe find php.exe (drag it to cmd)
(32.16input command php.exe-f "actual file path"
Note: The runtime code php.exe-r "code"
Concept:
In the running mode of web software, a request is always initiated on the client (browser), and then the server generates feedback (that is, the "running" program ), and then return the information to the browser (response)
Ii. web running process
1. Enter the address in the browser and press enter to send the request)
2. Find the corresponding web server according to the rule
(1) first, find the corresponding IP address in the hosts file of the local machine.
Location: Operating System/system32/drivers/etc/
Note: you must open the editor as an administrator before editing and saving the editor.
(2) If hosts is not found, find the corresponding IP address on the Internet (in the DNS server)
(3) The request is still not found. If the request is terminated, the message "server not found" is returned.
3. The web server obtains the corresponding file (the requested file)
4. If necessary, process the file (PHP code execution)
5. Return the file (or execution result file) to the browser (response)
6. the browser accepts files.
7. the browser processes the file (display/execute)
PHP webpage running principle